0% found this document useful (0 votes)
34 views8 pages

Design

The document describes a Visual Basic .NET program that calculates a student's semester grade point average. It takes input from the user for course grades and units, assigns a letter grade based on ranges, calculates individual grade scores by multiplying grade by units, sums the total score and units, and displays the semester GPA by dividing total score by total units. Pseudocode is provided to outline the program's logic and flow.

Uploaded by

Oyebanji Yusuph
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)
34 views8 pages

Design

The document describes a Visual Basic .NET program that calculates a student's semester grade point average. It takes input from the user for course grades and units, assigns a letter grade based on ranges, calculates individual grade scores by multiplying grade by units, sums the total score and units, and displays the semester GPA by dividing total score by total units. Pseudocode is provided to outline the program's logic and flow.

Uploaded by

Oyebanji Yusuph
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/ 8

DESIGN

DESIGN

IMPLEMENTATION (source Code)


Public Class Form2
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim course1, course2, course3, course4, course5, course6, course7, course8 As Double '

Dim unit1, unit2, unit3, unit4, unit5, unit6, unit7, unit8, totalunits As Integer '
Dim score1, score2, score3, score4, score5, score6, score7, score8 As Double

course1 = Val(TextBox1.Text)
course2 = Val(TextBox3.Text)
course3 = Val(TextBox5.Text)
course4 = Val(TextBox7.Text)
course5 = Val(TextBox9.Text)
course6 = Val(TextBox11.Text)
course7 = Val(TextBox13.Text)
course8 = Val(TextBox15.Text)
unit1 = Val(TextBox2.Text)
unit2 = Val(TextBox4.Text)
unit3 = Val(TextBox6.Text)
unit4 = Val(TextBox8.Text)
unit5 = Val(TextBox10.Text)
unit6 = Val(TextBox12.Text)
unit7 = Val(TextBox14.Text)
unit8 = Val(TextBox16.Text)

If course1 > 100 Then


TextBox17.Text = "iNVALID"
ElseIf course1 >= 70 Then
TextBox17.Text = "A"
score1 = 5 * unit1
ElseIf course1 >= 60 Then
TextBox17.Text = "B"
score1 = 4 * unit1
ElseIf course1 >= 50 Then
TextBox17.Text = "C"
score1 = 3 * unit1
ElseIf course1 >= 45 Then
TextBox17.Text = "D"
score1 = 2 * unit1
ElseIf course1 >= 40 Then
TextBox17.Text = "E"
score1 = 1 * unit1
ElseIf course1 <= 39
TextBox17.Text = "F"
score1 = 0 * unit1
ElseIf course1 = 1
TextBox17.Text = ""

End If

If course2 > 100 Then


TextBox18.Text = "iNVALID"
ElseIf course2 >= 70 Then
TextBox18.Text = "A"
score2 = 5 * unit2
ElseIf course2 >= 60 Then
TextBox18.Text = "B"
score2 = 4 * unit2
ElseIf course2 >= 50 Then
TextBox18.Text = "C"
score2 = 3 * unit2
ElseIf course2 >= 45 Then
TextBox18.Text = "D"
score2 = 2 * unit2
ElseIf course2 >= 40 Then
TextBox18.Text = "E"
score2 = 1 * unit2
Else
TextBox18.Text = "F"
score2 = 0 * unit2

End If

If course3 > 100 Then


TextBox19.Text = "iNVALID"
ElseIf course3 >= 70 Then
TextBox19.Text = "A"
score3 = 5 * unit3
ElseIf course3 >= 60 Then
TextBox19.Text = "B"
score3 = 4 * unit3
ElseIf course3 >= 50 Then
TextBox19.Text = "C"
score3 = 3 * unit3
ElseIf course3 >= 45 Then
TextBox19.Text = "D"
score3 = 2 * unit3
ElseIf course3 >= 40 Then
TextBox19.Text = "E"
score3 = 1 * unit3
Else
TextBox19.Text = "F"
score3 = 0 * unit3
End If

If course4 > 100 Then


TextBox20.Text = "iNVALID"
ElseIf course4 >= 70 Then
TextBox20.Text = "A"
score4 = 5 * unit4
ElseIf course4 >= 60 Then
TextBox20.Text = "B"
score4 = 4 * unit4
ElseIf course4 >= 50 Then
TextBox20.Text = "C"
score4 = 3 * unit4
ElseIf course4 >= 45 Then
TextBox20.Text = "D"
score4 = 2 * unit4
ElseIf course4 >= 40 Then
TextBox20.Text = "E"
score4 = 1 * unit4
Else
TextBox20.Text = "F"
score4 = 0 * unit4
End If

If course5 > 100 Then


TextBox21.Text = "iNVALID"
ElseIf course5 >= 70 Then
TextBox21.Text = "A"
score5 = 5 * unit5
ElseIf course5 >= 60 Then
TextBox21.Text = "B"
score5 = 4 * unit5
ElseIf course5 >= 50 Then
TextBox21.Text = "C"
score5 = 3 * unit5
ElseIf course5 >= 45 Then
TextBox21.Text = "D"
score5 = 2 * unit5
ElseIf course5 >= 40 Then
TextBox21.Text = "E"
score5 = 1 * unit5
Else
TextBox21.Text = "F"
score5 = 0 * unit5

End If
If course6 > 100 Then
TextBox22.Text = "iNVALID"
ElseIf course6 >= 70 Then
TextBox22.Text = "A"
score6 = 5 * unit6
ElseIf course6 >= 60 Then
TextBox22.Text = "B"
score6 = 4 * unit6
ElseIf course6 >= 50 Then
TextBox22.Text = "C"
score6 = 3 * unit6
ElseIf course6 >= 45 Then
TextBox22.Text = "D"
score6 = 2 * unit6
ElseIf course6 >= 40 Then
TextBox22.Text = "E"
score6 = 1 * unit6
Else
TextBox22.Text = "F"
score6 = 0 * unit6
End If
If course7 > 100 Then
TextBox23.Text = "iNVALID"
ElseIf course7 >= 70 Then
TextBox23.Text = "A"
score7 = 5 * unit7
ElseIf course7 >= 60 Then
TextBox23.Text = "B"
score7 = 4 * unit7
ElseIf course7 >= 50 Then
TextBox23.Text = "C"
score7 = 3 * unit7
ElseIf course7 >= 45 Then
TextBox23.Text = "D"
score7 = 2 * unit7
ElseIf course7 >= 40 Then
TextBox23.Text = "E"
score7 = 1 * unit7
Else
TextBox23.Text = "F"
score7 = 0 * unit7

End If
If course8 > 100 Then
TextBox24.Text = "iNVALID"
ElseIf course8 >= 70 Then
TextBox24.Text = "A"
score8 = 5 * unit8
ElseIf course8 >= 60 Then
TextBox24.Text = "B"
score8 = 4 * unit8
ElseIf course8 >= 50 Then
TextBox24.Text = "C"
score8 = 3 * unit8
ElseIf course8 >= 45 Then
TextBox24.Text = "D"
score8 = 2 * unit8
ElseIf course8 >= 40 Then
TextBox24.Text = "E"
score8 = 1 * unit8
Else
TextBox24.Text = "F"
score8 = 0 * unit8

End If

Dim totalscore, gradepoint As Double


totalscore = score1 + score2 + score3 + score4 + score5 + score6 + score7 + score8
totalunits = unit1 + unit2 + unit3 + unit4 + unit5 + unit6 + unit7 + unit8

gradepoint = totalscore / totalunits

TextBox25.Text = totalscore
TextBox26.Text = gradepoint
TextBox27.Text = totalunits

End Sub

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


TextBox25.TextChanged

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs)

End Sub
Private Sub Label26_Click(sender As Object, e As EventArgs) Handles Label26.Click

End Sub
End Class

Problem Specification
Develop a program using VB.net to calculate the semester grade point of a student

Problem Analysis
This program will be collecting from the user the no of courses offered for the
particular semester and would also require the user enters the courses and its
corresponding unit.
The total number of units is computed, and total grade point is also calculated after
user enters grade. It outputs the grade for each course on empty textboxes for the
user to see.
For example if a number above or equals 70 is inputted then the user got an A for
that particular course.

The total grade score is also calculated by multiplying each grade score by the unit
for the particular course.

S/ SCORE RANGE GRADE GRADE SCORE


N
1. 70-100 A 5
2. 60-69 B 4
3. 50-59 C 3
4. 45-49 D 2
5. 40-44 E 1
6. 0-39 F 0

The Total Grade Point is the sum of the individual grade point.
The Semester Grade point is calculated this:
Total Grade Point acquired / Total Number of Course Units Offered
FLOWCHART
INVALID INPUT
IF SCORES: VALID?
START

TOTAL NEW WINDOWS


INPUTUNITS,
COURSE
ENTER
OUTPUT NOSCORE AND
OFPOINT
GRADE
GRADE
FORM
CORRESPONDING
COURSES
END
AND FOR UNIT
COURSE INPUT
GRADE POINTENDAVERAGE

You might also like