General

Chat

English metric converter on excel qbasic page 91

I'm haveing a hard time with this. Purpose:
To become familiar with using of top-down approach to problem solving, the INT function, declaring double-precision variables and constants to specify double-precision arathmetic, and a procedure for rounding.

Problem:
Design a program flowchart and write a top-down modular program to convert an English measurment in miles, yards, feet, and inches, to a metric measurement in Kilometer, meters, and centimeters. Use the following formula to change the English measurements to inches:

Total Inches = 63360 * Miles + 36 * Yards + 12 * Feet + Inches

Use the following formula to determine the equivalent meters:

Meters = (Total Inches / 39.37)

The variable used to represent the number of meters and the numeric conttand 39.37 must be declared double precision -- add a trailing number sign (#) to each. (This instructs the PC to cary out double-precision arithmetic.) Use the INT function to determine the number of kilometers, meters, and centimeters. Round the centimeters to two decimal places.

(HINT: After the number of meters has been determined, the maximum number of kilometers can be computed from: Kilometers = INT(Meters/1000). Next, they remaining meters can be determined from: Remaining Meters = Meters - 1000 * Kilometers. The number of integer meters in Remaining Meters can be determined from: Integer Meters = INT(Remaining Meters). Continue with the same technique to comput the number of centimeters.)

Ok Input:
Miles: 2
Yards: 5
Feet: 2
Inches: 7

I'm about 90% done with it all I have to do is find centimeters the answers go a followed:
_ _ _ Kilometers: 3
_ _ _ Meters: 224
_ _ _ Centimeters: 5.38
I currently have no formula/function on how to get centimeters. Can anyone help? Please?

Heres a picture of what I have http://tinypic.com/r/653jer/9

December 22, 2015