- Version
- Download 796
- File Size 66.47 KB
- File Count 1
- Create Date April 25, 2016
- Last Updated April 25, 2016
Grade Computation in Visual Basic .Net
Grade Computation in Visual Basic .Net
Windows form application in vb.net that computes final grade and display the status if failed or passed.
To compute the final grade: 30% of prelim grade + 30% of midterm grade and 40% of endterm grade.
If grade is equal 75 and above then you passed, below 75 failed.
Open the project solution (.sln) in visual studio 2010/2012 or open directly the project file (.vbproj)
Source code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If IsNumeric(TextBox1.Text) = False Or IsNothing(TextBox1.Text) = True Then
MessageBox.Show("Please enter a numeric value")
TextBox1.Focus()
ElseIf IsNumeric(TextBox2.Text) = False Or IsNothing(TextBox2.Text) = True Then
MessageBox.Show("Please enter a numeric value")
TextBox2.Focus()
ElseIf IsNumeric(TextBox3.Text) = False Or IsNothing(TextBox3.Text) = True Then
MessageBox.Show("Please enter a numeric value")
TextBox3.Focus()
Else
Label5.Text = ((TextBox1.Text * 0.3) + (TextBox2.Text * 0.3) + (TextBox3.Text * 0.4))
If Val(Label5.Text) >= 75 Then
Label7.Text = "Passed"
Else
Label7.Text = "Failed"
End If
End If
End Sub
End Class