-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimes.vb
62 lines (45 loc) · 1.74 KB
/
times.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Imports System.Transactions
Public Class times
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim tim As Double
tim = TextBox1.Text
If tim >= 5 And tim < 12 Then
MsgBox("Good Morning")
ElseIf tim >= 12 And tim < 18 Then
MsgBox("Good Afternoon")
ElseIf tim >= 18 And tim < 21 Then
MsgBox("Good Evening")
ElseIf tim >= 21 Then
MsgBox("Good Night")
Else
MsgBox("Incorect time format")
End If
End Sub
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim first, second As Double
Try
first = Double.Parse(TextBox2.Text)
second = Double.Parse(TextBox3.Text)
If second = 0 Then
MsgBox("Cannot divide by zero")
Else
Dim result As Single = first / second
MsgBox("Result of the operation is " & result.ToString)
End If
Catch ex As Exception
MsgBox("Not a valid numeric entry")
End Try
End Sub
Private Sub Label7_Click(sender As Object, e As EventArgs) Handles Label7.Click
End Sub
Private Sub Label8_Click(sender As Object, e As EventArgs) Handles Label8.Click
Dim first, second, product, average As Single
first = InputBox("Enter the first Number")
second = InputBox("the second number")
product = first * second
average = (first + second) / 2
Label8.Text = ("The product is: " & product & " ,The average is:" & average)
End Sub
End Class