You are on page 1of 2

Public Class Form1

Dim result
Dim resulta As String
Dim remark As String

Private Sub BtnCom_Click(sender As Object, e As EventArgs) Handles BtnCom.Click

If RadioLet.Checked = True Then


TxtGrd.Text = resulta
TxtRmk.Text = remark
ListBox1.Items.Add(TxtName.Text)
ListBox1.Items.Add(TxtGrd.Text)
ListBox1.Items.Add(TxtRmk.Text)
End If
If RadioNum.Checked = True Then
TxtGrd.Text = result.ToString
TxtRmk.Text = remark
ListBox1.Items.Add(TxtName.Text)
ListBox1.Items.Add(TxtGrd.Text)
ListBox1.Items.Add(TxtRmk.Text)
End If

End Sub

Private Sub BtnEnt_Click(sender As Object, e As EventArgs) Handles BtnEnt.Click


If MsgBox("Do you want a new entry?", vbQuestion + vbYesNo, "New Entry") =
vbYes Then
TxtName.Clear()
TxtExa.Clear()
TxtGrd.Clear()
TxtHom.Clear()
TxtRmk.Clear()
TxtTxts.Clear()
RadioNum.Checked = False
RadioLet.Checked = False
End If

End Sub

Private Sub BtnExit_Click(sender As Object, e As EventArgs) Handles


BtnExit.Click
If MsgBox("Do you want to exit?", vbQuestion + vbYesNo, "Question") = vbYes
Then

End
End If

End Sub

Private Sub RadioNum_CheckedChanged(sender As Object, e As EventArgs) Handles


RadioNum.CheckedChanged
Dim hom As Single = Val(TxtHom.Text)
Dim test As Single = Val(TxtTxts.Text)
Dim Finalexa As Single = Val(TxtExa.Text)
result = hom * 0.2 + test * 0.3 + Finalexa * 0.5
If result >= 9 And result <= 10 Then
remark = "Outstanding"

End If
If result >= 8 And result < 9 Then

remark = "Remarkable"
End If
If result >= 7 And result < 8 Then

remark = "Enough"
End If
If result >= 6 And result < 7 Then

remark = "Low"
End If
If result >= 0 And result < 6 Then

remark = "Insufficient"
End If

End Sub

Private Sub RadioLet_CheckedChanged(sender As Object, e As EventArgs) Handles


RadioLet.CheckedChanged
Dim hom As Single = Val(TxtHom.Text)
Dim test As Single = Val(TxtTxts.Text)
Dim Finalexa As Single = Val(TxtExa.Text)
result = hom * 0.2 + test * 0.3 + Finalexa * 0.5
If result >= 9 And result <= 10 Then

resulta = "A"
remark = "Outstanding"

End If
If result >= 8 And result < 9 Then

resulta = "B"
remark = "Remarkable"
End If
If result >= 7 And result < 8 Then

resulta = "C"
remark = "Enough"
End If
If result >= 6 And result < 7 Then

resulta = "D"
remark = "Low"
End If
If result >= 0 And result < 6 Then

resulta = "F"
remark = "Insufficient"
End If

You might also like