0% found this document useful (0 votes)
47 views

Form1: "Do You Want A New Entry?" "New Entry"

This document contains code for a form that allows a user to enter student exam scores and calculates a grade and remark. It defines variables to store the result, grade as a string or number, and remark. Buttons allow adding a new entry, calculating and displaying the grade when exam type radio buttons are checked, and exiting. Checking the radio buttons triggers calculating the grade based on weighted exam scores and assigning a letter grade or number and remark.
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)
47 views

Form1: "Do You Want A New Entry?" "New Entry"

This document contains code for a form that allows a user to enter student exam scores and calculates a grade and remark. It defines variables to store the result, grade as a string or number, and remark. Buttons allow adding a new entry, calculating and displaying the grade when exam type radio buttons are checked, and exiting. Checking the radio buttons triggers calculating the grade based on weighted exam scores and assigning a letter grade or number and remark.
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/ 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