# yeah i tried that, didnt work....

Posted by atulb84 (93 se) on September 17, 2004 at 09:57:09: In Reply to: Have you tried centimeters = int(meters * 100) n/m posted by Perivs Anathema on September 17, 2004 at 09:48:29: the example in my book has the user enter 5 miles, 20 yards, 2 feet, and 4 inches. After they click the convert button, it comes out to 8 km, 65 m, and supposed to be 73.5 cm. I did it in my calculator. And like the total inches came out to 317548. When you divide that by 39.37 to get total meters, it comes out to 8065.735331. To get km, you divide that by 1000 and so it comes out to 8.065735331. But since I have to use the Int operator, it just makes it 8, which is correct. The remainder of that (.065735331) times 1000 gives me the correct number of meters which is 65 (after Int). The remainder of that is .735331. When you multiply that remainder times 100, you get 73.5 cm, which is right according to my book. I just cant figure out the calculation for it. :( Replys:

Name: |
E-Mail |
Car: |
Subject |
Message:
: the example in my book has the user enter 5 miles, 20 yards, 2 feet, and 4 inches. After they click the convert button, it comes out to 8 km, 65 m, and supposed to be 73.5 cm. : : I did it in my calculator. And like the total inches came out to 317548. When you divide that by 39.37 to get total meters, it comes out to 8065.735331. To get km, you divide that by 1000 and so it comes out to 8.065735331. But since I have to use the Int operator, it just makes it 8, which is correct. The remainder of that (.065735331) times 1000 gives me the correct number of meters which is 65 (after Int). The remainder of that is .735331. When you multiply that remainder times 100, you get 73.5 cm, which is right according to my book. I just cant figure out the calculation for it. :(