Friday
August 22, 2014

Homework Help: visual basic

Posted by cl on Friday, May 8, 2009 at 1:11pm.

here is my source code for my program im trying to convert 10 units from furlong to meters the answer is supposed to be 2011.68 meters
i keep getting 2000. I know if i cant get this right the rest of the conversion will give the wrong answers anybody have any ideas?
Dim inch As Long
Dim fathom As Long
Dim foot As Long
Dim furlong As Long
Dim kilometer As Long
Dim meter As Long
Dim rod As Long
Dim miles As Long
Dim yard As Long
Dim Feet As Long
Dim Original As Long
Dim Desired As Long
Dim A(0 To 9) As Long
Dim B(0 To 9) As Long
Dim result As Long



Private Sub convertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertButton.Click

Feet = Val(ConvertText.Text)
Original = Val(OUnitsTexT.Text)
Desired = Val(DUnitsText.Text)

inch = 0.0833 * Feet
yard = 3 * Feet
meter = 3.28155 * Feet
fathom = 6 * Feet
rod = 16.5 * Feet
furlong = 660 * Feet
kilometer = 3281.5 * Feet
miles = 5280 * Feet


A(1) = inch
A(2) = fathom
A(3) = foot
A(4) = furlong
A(5) = kilometer
A(6) = meter
A(7) = miles
A(8) = rod
A(9) = yard

B(1) = inch
B(2) = fathom
B(3) = Feet
B(4) = furlong
B(5) = kilometer
B(6) = meter
B(7) = miles
B(8) = rod
B(9) = yard

result = ((A(Original)) / ((B(Desired)) / Feet))

lengthText.Text = Val(result)
lengthText.Text = FormatNumber(result, 2, , , TriState.True)

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

visual basic - Doing a units of measurement program dont know what the formula i...
Programming - Here is the question that I need help to write the code for the ...
physics - You are standing 7.0 meters from a sound source that radiates equally ...
PROGRAMMING - PLS, I NEED TO BE GUIDED ON HOW TO WRITE A SIMPLE PROGRAM IN BASIC...
Physics - PLEASE HELP, I'm trying to study for a quiz >.< and I don't ...
C++ program - Please help am not very good at c program. Am supposed to create a...
Programming (Visual Basic) - Im seem to be having trouble with this Exercise. ...
Geometry - Can you check these multiple choice questions thanks. 1. What is the ...
Programming - How would the flow charts and pseudocode look for this? The Metric...
visual basic - in visual basic, notes in a program which explain what the ...

Search
Members