# Quick question...

Posted by atulb84 (93 SE) on September 17, 2004 at 09:42:20: In Reply to: What do you want to know? n/m posted by Pervis Anathema on September 17, 2004 at 03:43:35: I just started to take some CIS classes. Anyway, this is my first "real" program in VB. I have to make a program that allows the user to enter the number of miles, yards, feet, and inches and it converts it into kilometers, meters, and centimeters. The program requires that we use the 'INT' function to break the number of kilometers and meters. The centimeters have to be rounded to one decimal place. I have done everything, but I cant figure out how to get the number of centimeters. This is what I have done for the other two formulas... totalinches = ((63360 * miles) + (36 * yards) + (12 * feet) + (inches)) totalmeters = totalinches / 39.37 kilometers = Int(totalmeters / 1000) meters = Int(totalmeters Mod 1000) centimeters = ? Any help would be appreciated. Thanks in advance Replys: IT WORKS IT WORKS!!! Thanks to everyone who helped. Thank youuuuuu. =) n/m atulb84 (93 SE) 14:54:07 9/17/2004 (0) Try this Will (92 GXE) 12:41:34 9/17/2004 (3) Geez, I think I need to retake my programming classes :wall: Will (92gxe) 13:09:49 9/17/2004 (1) WOW, you rock. It came out to 73. I need to round it to one decimal place though, and that should be 73.5. Would I just take off the Int and do math.round(centimeters,1)? nm atulb84 (93 se) 14:33:33 9/17/2004 (0) Whoops, typo on previous post Will (92GXE) 12:45:53 9/17/2004 (0) actually, i don't thinl that will work, i think i see why now.... lophix (94se) 11:04:09 9/17/2004 (5) ok a quick check gives 0... lophix (94se) 11:07:44 9/17/2004 (4) btw, programming is not my strong point obviously, so chances I'm wrong are real high nm lophix (94se) 11:09:23 9/17/2004 (3) damn, tried all those ideas, still cant get it. thanks for the help though fellas. i REALLY appreciate it. nm atulb84 (93 se) 13:32:13 9/17/2004 (2) this is really sad...CS major and I can't settle down to do this.... lophix (94se) 13:37:48 9/17/2004 (1) lol, its really been bothering me since late last night. i even asked my roomates, who are math majors, to come up with a formula, and we just couldnt get it into vb code. thanks though! nm atulb84 (93 se) 13:46:49 9/17/2004 (0) Have you tried centimeters = int(meters * 100) n/m Perivs Anathema (91 SE) 09:48:29 9/17/2004 (1) yeah i tried that, didnt work.... atulb84 (93 se) 09:57:09 9/17/2004 (0)

Name: |
E-Mail |
Car: |
Subject |
Message:
: I just started to take some CIS classes. Anyway, this is my first "real" program in VB. I have to make a program that allows the user to enter the number of miles, yards, feet, and inches and it converts it into kilometers, meters, and centimeters. The program requires that we use the 'INT' function to break the number of kilometers and meters. The centimeters have to be rounded to one decimal place. I have done everything, but I cant figure out how to get the number of centimeters. This is what I have done for the other two formulas... : totalinches = ((63360 * miles) + (36 * yards) + (12 * feet) + (inches)) : totalmeters = totalinches / 39.37 : kilometers = Int(totalmeters / 1000) : meters = Int(totalmeters Mod 1000) : centimeters = ? : : Any help would be appreciated. Thanks in advance