Text: Visual Basic project question:
Project 1 Specifications: Metric Conversion
Write a program to convert a U.S. Customary System length in
miles, yards, feet, and inches to a Metric System length in
kilometers, meters, and centimeters. A Sample run is shown below.
After the number of miles, yards, feet, and inches are read from
the text boxes, the length should be converted entirely to inches
and then divided by 39.37 to obtain the value in meters. The Int
function should be used to break the total number of meters into a
whole number of kilometers and meters. The number of centimeters
should be displayed to one decimal place. Use the naming convention
provided for all controls on the form and all variables used. The
needed formulas are as follows:
dblTotal_inches = (63360 * intMiles) + (36 * intYards) + (12 *
intFeet) + intInches
dblTotal_meters = dblTotal_inches / 39.37
intKilometers = Int(dblTotal_meters/1000)
Points:
1) Every procedure has a comment
2) Block comment at the beginning of Class Form
3) All objects follow the naming convention
4) Form constructed correctly (Appearance only)
5) Program inputs data from text boxes to variables
6) Calculates the Metric Values correctly
7) The displays values using correct formatting
8) Ensure the tab order is correct from Miles
Shown at Start up:
Project1: Length Conversion
Miles:
Yards:
Convert To Metric
Feet:
0
Inches:
0
Shown after entering data and clicking on the button:
Project1: Length Conversion
-0x
Miles:
5
Yards:
20
Feet:
32
Inches:
4
Convert To Metric
The Metric Length is 8 kilometers 65 meters. 73.5 centimeters.