1.11M Members

VB Metric Standard Conversions

 
0
 

hey im trying to create a program that will convert between metric and standard units.I chose length as my measurement so i have nanometer,millimeter,centimeter,meter,hectometer,kilometer,inc,feet,yard and mile.
i wanted the inpu to be
- number to be converted(text box)
-unit number is in(combo box)
-unit to convert to(combo box)
i know how to do combo boxes,buttons and labels and stuff.
The output is the converted number this is what i have so far but its soooo wrong please help meeeeeeee:(

Public Class Form1

    Private Sub Convert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Convert.Click
        Dim Inch, Feet, Yard, Mile As Integer
        Dim Nanometer, Millimeter, Centimeter, Meter, Hectometer, Kilometer As Double

        Mile = CInt(Text)
        Yard = CInt(Text)
        Feet = CInt(Text)
        Inch = 63360 * Mile + 36 * Yard + 12 * Feet + Inch
        Meter = (Inch / 39.37)
        Kilometer = (Meter / 1000)
        Nanometer = (Meter * 1000000000)
        Millimeter = (Meter * 10000)
        Centimeter = (Meter * 100)
        Hectometer=(Meter/100)





    End Sub
End Class
 
0
 

Please take the time to ask a coherent question. If you can't be bothered to explaini it properly then don't expect a coherent answer. For example

i wanted the inpu to be
- number to be converted(text box)

I presume this means "The number to be converted is input by the user in a textbox". Put a little more effort into the question.

 
0
 

No it means what I said.the number that will be converted(let's say 7)will be in a text box while the units its in will be in one combo box(let's say mm) and the units it will be converted to say m will be in another combo box.

 
0
 

And how is

"The number to be converted is input by the user in a textbox"

different from

the number that will be converted(let's say 7)will be in a text box

 
0
 

No difference.I was explaining it more since you didn't seem to understand.

Question Answered as of 2 Years Ago by Reverend Jim
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article