0% found this document useful (0 votes)
20 views1 page

Code

The document defines numeric variables for different currencies and assigns values from text boxes to convert amounts between currencies. It also defines event handler methods for buttons to calculate the area of a rectangle from length and width, area of a triangle from base and height, and the area of a square from the length of a side.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Code

The document defines numeric variables for different currencies and assigns values from text boxes to convert amounts between currencies. It also defines event handler methods for buttons to calculate the area of a rectangle from length and width, area of a triangle from base and height, and the area of a square from the length of a side.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Dim euro, usd, ukd, yen, hkd, sd As Double

euro = Val(TextBox1.Text)
usd = Val(TextBox2.Text)
ukd = Val(TextBox3.Text)
yen = Val(TextBox4.Text)
hkd = Val(TextBox5.Text)
sd = Val(TextBox6.Text)
TextBox7.Text = euro * 57.46
TextBox8.Text = usd * 51.63
TextBox9.Text = ukd * 62.77
TextBox10.Text = yen * 0.48
TextBox11.Text = hkd * 6.59
TextBox12.Text = sd * 37.5
End Sub
End Class

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
Dim L, W, AoR
L = Val(TextBox1.Text)
W = Val(TextBox2.Text)
AoR = L * W
TextBox3.Text = AoR
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
Dim B, H, AoT
B = Val(TextBox4.Text)
H = Val(TextBox5.Text)
AoT = (B * H) / 2
TextBox6.Text = AoT
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button3.Click
Dim S, AoS As Integer
S = Val(TextBox7.Text)
AoS = S ^ 2
TextBox8.Text = AoS
End Sub
End Class

Numeric variables contain only numbers and are suitable for numeric calculations such as addition and
multiplication. String variables may contain letters, numbers and other characters. You can't do
calculations on string variables -even if they contain only numbers.

You might also like