You are on page 1of 2

Public Class Form1

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


Button1.Click

Dim a, b, c, d, e1, ave As Single

Dim G, G1, G2, G3, G4 As String

a = TextBox1.Text

b = TextBox2.Text

c = TextBox3.Text

d = TextBox4.Text

e1 = a + b + c + d

ave = e1 / 4

G = "The result is " & ave

G1 = G & vbNewLine & "The remarks is Passed" & vbNewLine & "Congratulations!! Moving Up..."

G2 = G & vbNewLine & "The remarks is Conditional" & vbNewLine & "Goodluck on your remedial"

G3 = G & vbNewLine & "The remarks is Failed" & vbNewLine & "Welcome Back..."

G4 = G & vbNewLine & "Invalid Grade Try Again.."

If ave >= 74 And ave <= 100 Then

Label7.Text = G1

ElseIf ave >= 69 And ave <= 76 Then

Label7.Text = G2

ElseIf ave >= 60 And ave <= 70 Then

Label7.Text = G3

ElseIf ave >= 0 And ave <= 59 Then

Label7.Text = G4

End If

End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button2.Click

TextBox1.Text = ""

TextBox2.Text = ""

TextBox3.Text = ""

TextBox4.Text = ""

Label7.Text = "RESULTS"

End Sub

End Class

You might also like