Qwerty

Only available on StudyMode
  • Download(s) : 81
  • Published : April 9, 2013
Open Document
Text Preview
ACTIVITY 1

Public Class no1
Private Const Mt = 0.3048
Dim a As Double
Dim b As Double
Private Const Ft = 5280
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

b = ((Ft * Mt) * a) / 1000
TextBox2.Text = FormatNumber(b, 2)

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged a = Val(TextBox1.Text)
End Sub

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged

End Sub

End Class

Public Class no2
Private Const inch = 2.54
Private Const ft = 12
Dim a As Double
Dim b As Double
Dim c As Double

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged a = Val(TextBox1.Text)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click b = a / inch
TextBox3.Text = b
c = b / ft
TextBox2.Text = c
End Sub

End Class

Public Class no3

Private Const Pound = 454
Dim a As Double
Dim b As Double

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

b = a / Pound
TextBox2.Text = FormatNumber(b, 2)

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged a = Val(TextBox1.Text)
End Sub

End Class

Public Class no4

Private Const week = 168
Private Const days = 24
Dim x As Double
Dim a As Double
Dim b As Double
Dim c As Double
Dim d As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If x >= week Then
a = Fix(x / week)
TextBox2.Text = a
a = x - (week * a)
If a >= days Then
b = Fix(a / days)
TextBox3.Text = b
b = a - (days * b)
Else
TextBox3.Text = 0
b = a
End If
c = b
TextBox4.Text = c
Else
TextBox2.Text = 0
a = x
If a >= days Then
b = Fix(a / days)
TextBox3.Text = b
b = a - (days * b)
Else
TextBox3.Text = 0
b = a
End If
c = b
TextBox4.Text = c
End If

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged x = Val(TextBox1.Text)
End Sub

End Class

Public Class no5

Private Const hour = 3600
Private Const minute = 60
Dim x As Double
Dim a As Double
Dim b As Double
Dim c As Double
Dim d As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If x >= hour Then
a = Fix(x / hour)
TextBox2.Text = a
a = x - (hour * a)
If a >= minute Then
b = Fix(a / minute)
TextBox3.Text = b
b = a - (minute * b)
Else
TextBox3.Text = 0
b = a
End If
c = b
TextBox4.Text = c
Else
TextBox2.Text = 0
a = x
If a >= minute Then
b = Fix(a / minute)
TextBox3.Text = b
b = a - (minute * b)
Else
TextBox3.Text = 0
b = a
End If...
tracking img