COMPUTATION OF GRADE 1.
1
-Public Class Form1
Dim grade As Decimal
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim intSubject1 As Double = TextBox1.Text
Dim intSubject2 As Double = TextBox2.Text
Dim intSubject3 As Double = TextBox3.Text
Dim intSubject4 As Double = TextBox4.Text
Dim intSubject5 As Double = TextBox5.Text
Dim intAnswer As Double
Dim intAdd As Double
intAdd = (intSubject1 + intSubject2 + intSubject3 + intSubject4 + intSubject5) / 5
intAnswer = intAdd
Me.Label6.Text = "Your Average Is = " & intAnswer
If intAnswer >= 98 And intAnswer <= 100 Then
Label7.Text = "Equivalent 1"
ElseIf intAnswer >= 95 And intAnswer <= 97 Then
Label7.Text = "Equivalent 1.25"
ElseIf intAnswer >= 92 And intAnswer <= 94 Then
Label7.Text = "Equivalent 1.5"
ElseIf intAnswer >= 89 And intAnswer <= 91 Then
Label7.Text = "Equivalent 1.75"
ElseIf intAnswer >= 86 And intAnswer <= 88 Then
Label7.Text = "Equivalent 2"
ElseIf intAnswer >= 83 And intAnswer <= 85 Then
Label7.Text = "Equivalent 2.25"
ElseIf intAnswer >= 80 And intAnswer <= 82 Then
Label7.Text = "Equivalent 2.5"
ElseIf intAnswer >= 77 And intAnswer <= 79 Then
Label7.Text = "Equivalent 2.75"
ElseIf intAnswer >= 75 And intAnswer <= 76 Then
Label7.Text = "Equivalent 3"
ElseIf intAnswer <= 73 And intAnswer <= 74 Then
Label7.Text = "Equivalent INC"
ElseIf intAnswer <= 72 Then
Label7.Text = "Equivalent Failed"
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 = " "
TextBox5.Text = " "
Label6.Text = "Average"
Label7.Text = "Equivalent"
- End Sub
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class
COMPUTATION OF GRADE 1.2 PASSED OR FAILED
-Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim response As Byte
response = MessageBox.Show("All entries Correct?", "Compute", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If response = DialogResult.Yes Then
txtName.Clear()
txtName.Focus()
txtPrelim.Clear()
txtMidterm.Clear()
txtFinal.Clear()
txtSemGrade.Clear()
txtEquivalent.Clear()
TextBox7.Clear()
End If
End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim response As Byte
response = MessageBox.Show("All entries Correct?", "Compute", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If response = DialogResult.Yes Then
txtSemGrade.Text = (txtPrelim.Text / 100) * 25 + (txtMidterm.Text / 100) * 25 + (txtFinal.Text / 100) * 50
If txtSemGrade.Text = 100 Then
txtEquivalent.Text = "1.00"
TextBox7.Text = "Passed"
ElseIf txtSemGrade.Text >= 95 Then
txtEquivalent.Text = "1.50"
TextBox7.Text = "Passed"
ElseIf txtSemGrade.Text >= 90 Then
txtEquivalent.Text = "2.00"
TextBox7.Text = "Passed"
ElseIf txtSemGrade.Text >= 85 Then
txtEquivalent.Text = "2.50"
TextBox7.Text = "Passed"
ElseIf txtSemGrade.Text >= 80 Then
txtEquivalent.Text = "3.00"
TextBox7.Text = "Passed"
ElseIf txtSemGrade.Text >= 75 Then
txtEquivalent.Text = "INC"
TextBox7.Text = "Passed"
Else : txtEquivalent.Text = "5.00"
TextBox7.Text = "Failed"
End If
End If
End Sub
- Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Label1.Text = Date.Now
End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
- Private Sub txtPrelim_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPrelim.TextChanged
End Sub
End Class
COMPUTATION OF GRADE 1.3 ABCDF
-Public Class Form1
Dim grade As Decimal
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim intSubject1 As Double = TextBox1.Text
Dim intSubject2 As Double = TextBox2.Text
Dim intSubject3 As Double = TextBox3.Text
Dim intSubject4 As Double = TextBox4.Text
Dim intSubject5 As Double = TextBox5.Text
Dim intAnswer As Double
Dim intAdd As Double
intAdd = (intSubject1 + intSubject2 + intSubject3 + intSubject4 + intSubject5) / 5
intAnswer = intAdd
Me.Label6.Text = "Your Average Is = " & intAnswer
If intAnswer >= 92 And intAnswer <= 100 Then
Label7.Text = "Equivalent A+"
ElseIf intAnswer >= 88 And intAnswer <= 91 Then
Label7.Text = " Equivalent A"
ElseIf intAnswer >= 85 And intAnswer <= 87 Then
Label7.Text = " Equivalent A-"
ElseIf intAnswer >= 82 And intAnswer <= 84 Then
Label7.Text = " Equivalent B+"
ElseIf intAnswer >= 78 And intAnswer <= 81 Then
Label7.Text = " Equivalent B"
ElseIf intAnswer >= 75 And intAnswer <= 77 Then
Label7.Text = " Equivalent B-"
ElseIf intAnswer >= 72 And intAnswer <= 74 Then
Label7.Text = " Equivalent C+"
ElseIf intAnswer >= 68 And intAnswer <= 71 Then
Label7.Text = " Equivalent C"
ElseIf intAnswer >= 65 And intAnswer <= 67 Then
Label7.Text = " Equivalent C-"
ElseIf intAnswer >= 55 And intAnswer <= 64 Then
Label7.Text = " Equivalent D"
ElseIf intAnswer <= 54 Then
Label7.Text = " Equivalent F"
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 = " "
TextBox5.Text = " "
Label6.Text = "Average"
Label7.Text = "Equivalent "
End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
CALCULATOR
-Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox4.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox5.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox6.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
TextBox4.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
TextBox5.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
TextBox6.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End Sub
- Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
TextBox1.Text = " "
TextBox2.Text = " "
TextBox3.Text = " "
TextBox4.Text = " "
TextBox5.Text = " "
TextBox6.Text = " "
End Sub
- Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Application.Exit()
End Sub
End Class