0% found this document useful (0 votes)
131 views11 pages

P5 ! Micheal

This program allows students to calculate their overall UCAS grade and number of points achieved. The user selects between pass, merit, or distinction grades for 12 units, and the program calculates the total points and determines the overall grade. It includes buttons to select grades, a progress bar to track selection, and displays the results.

Uploaded by

theguyz_2004
Copyright
© Attribution Non-Commercial (BY-NC)
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)
131 views11 pages

P5 ! Micheal

This program allows students to calculate their overall UCAS grade and number of points achieved. The user selects between pass, merit, or distinction grades for 12 units, and the program calculates the total points and determines the overall grade. It includes buttons to select grades, a progress bar to track selection, and displays the results.

Uploaded by

theguyz_2004
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 11

UCAS CALCULATOR

The purpose of this program is to calculate the overall grade of a student and also how
many UCAS points they have achieved. There are three buttons of the achievable grades,
pass merit or distinction, the students receive twelve overall grades and they simply click on
the relevant buttons in order to find out their overall grade and UCAS points. This program
also has an intro screen which allows the user to first choose their course.

PROPERTIES:
CODE AND IMPLEMETATION OF PROGRAM:
Public Class Form1
Dim PassUnitPoints As Integer
Dim MeritUnitPoints As Integer
Dim DestinctionUnitPoints As Integer
Dim GradeBoundaryPoints As Integer
Dim UCASPass As Integer
Dim UCASMerit As Integer
Dim UCASDestinction As Integer
Dim UnitCounter As Integer
Friend PMin As Integer
Friend PMax As Integer
Friend PPMin As Integer
Friend PPMax As Integer
Friend PPPMin As Integer
Friend PPPMax As Integer
Friend MPMin As Integer
Friend MPMax As Integer
Friend MPPMin As Integer
Friend MPPMax As Integer
Friend MMPMin As Integer
Friend MMPMax As Integer
Friend MMin As Integer
Friend MMax As Integer
Friend MMMin As Integer
Friend MMMax As Integer
Friend MMMMin As Integer
Friend MMMMax As Integer
Friend DMin As Integer
Friend DMax As Integer
Friend DMMin As Integer
Friend DMMax As Integer
Friend DMMMin As Integer
Friend DMMMax As Integer
Friend DDMMin As Integer
Friend DDMMax As Integer
Friend DDMin As Integer
Friend DDMax As Integer
Friend DDDMin As Integer
Friend DDDMax As Integer
Friend Condition As Integer

Private Sub CmdPass_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CmdPass.Click
PassUnitPoints = 6
GradeBoundaryPoints = GradeBoundaryPoints + PassUnitPoints
UCASPass = UCASPass + 1
UnitCounter = UnitCounter + 1
ProgressBar1.Value = ProgressBar1.Value + 1
TrBStatus.Value = TrBStatus.Value + 1
If TrBStatus.Value = TrBStatus.Maximum Then
CmdPass.Enabled = False
CmdMerit.Enabled = False
CmdDestinction.Enabled = False
End If
LblPass.Text = UCASPass & " Passes"
LblBoundaryPoints.Text = GradeBoundaryPoints & " Grade Boundary Points"
End Sub

Private Sub CmdMerit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CmdMerit.Click
MeritUnitPoints = 12
GradeBoundaryPoints = GradeBoundaryPoints + MeritUnitPoints
UCASMerit = UCASMerit + 1
UnitCounter = UnitCounter + 1
ProgressBar1.Value = ProgressBar1.Value + 1
TrBStatus.Value = TrBStatus.Value + 1
If TrBStatus.Value = TrBStatus.Maximum Then
CmdPass.Enabled = False
CmdMerit.Enabled = False
CmdDestinction.Enabled = False
End If
LblMerit.Text = UCASMerit & " Merits"
LblBoundaryPoints.Text = GradeBoundaryPoints & " Grade Boundary Points"
End Sub

Private Sub CmdDistinction_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CmdDestinction.Click
DestinctionUnitPoints = 18
GradeBoundaryPoints = GradeBoundaryPoints + DestinctionUnitPoints
UCASDestinction = UCASDestinction + 1
UnitCounter = UnitCounter + 1
ProgressBar1.Value = ProgressBar1.Value + 1
TrBStatus.Value = TrBStatus.Value + 1
If TrBStatus.Value = TrBStatus.Maximum Then
CmdPass.Enabled = False
CmdMerit.Enabled = False
CmdDestinction.Enabled = False
End If
LblDistinction.Text = UCASDestinction & " Destinctions"
LblBoundaryPoints.Text = GradeBoundaryPoints & " Grade Boundary Points"
End Sub

Private Sub CmdCalculate_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CmdCalculate.Click
If Condition = "1" Then
If GradeBoundaryPoints >= PMin And GradeBoundaryPoints <= PMax Then
LblGrade.Text = "Overall Grade: P"
LblPoints.Text = "40 UCAS Points"
ElseIf GradeBoundaryPoints >= MMin And GradeBoundaryPoints <= MMax Then
LblGrade.Text = "Overall Grade: M"
LblPoints.Text = "80 UCAS Points"
ElseIf GradeBoundaryPoints >= DMin And GradeBoundaryPoints <= DMax Then
LblGrade.Text = "Overall Grade: D"
LblPoints.Text = "120 UCAS Points"
Else
LblGrade.Text = "Overall Grade: Fail"
End If
End If
If Condition = "2" Then
If GradeBoundaryPoints >= PPMin And GradeBoundaryPoints <= PPMax Then
LblGrade.Text = "Overall Grade: PP"
LblPoints.Text = "80 UCAS Points"
ElseIf GradeBoundaryPoints >= MPMin And GradeBoundaryPoints <= MPMax Then
LblGrade.Text = "Overall Grade: MP"
LblPoints.Text = "120 UCAS Points"
ElseIf GradeBoundaryPoints >= MMMin And GradeBoundaryPoints <= MMMax Then
LblGrade.Text = "Overall Grade: MM"
LblPoints.Text = "160 UCAS Points"
ElseIf GradeBoundaryPoints >= DMMin And GradeBoundaryPoints <= DMMax Then
LblGrade.Text = "Overall Grade: DM"
LblPoints.Text = "200 UCAS Points"
ElseIf GradeBoundaryPoints >= DDMin And GradeBoundaryPoints <= DDMax Then
LblGrade.Text = "Overall Grade: DD"
LblPoints.Text = "240 UCAS Points"
Else
LblGrade.Text = "Overall Grade: Fail"
End If
End If
If Condition = "3" Then
If GradeBoundaryPoints >= PPPMin And GradeBoundaryPoints <= PPPMax Then
LblGrade.Text = "Overall Grade: PPP"
LblPoints.Text = "120 UCAS Points"
ElseIf GradeBoundaryPoints >= MPPMin And GradeBoundaryPoints <= MPPMax
Then
LblGrade.Text = "Overall Grade: MPP"
LblPoints.Text = "160 UCAS Points"
ElseIf GradeBoundaryPoints >= MMPMin And GradeBoundaryPoints <= MMPMax
Then
LblGrade.Text = "Overall Grade: MMP"
LblPoints.Text = "200 UCAS Points"
ElseIf GradeBoundaryPoints >= MMMMin And GradeBoundaryPoints <= MMMMax
Then
LblGrade.Text = "Overall Grade: MMM"
LblPoints.Text = "240 UCAS Points"
ElseIf GradeBoundaryPoints >= DMMMin And GradeBoundaryPoints <= DMMMax
Then
LblGrade.Text = "Overall Grade: DMM"
LblPoints.Text = "280 UCAS Points"
ElseIf GradeBoundaryPoints >= DDMMin And GradeBoundaryPoints <= DDMMax
Then
LblGrade.Text = "Overall Grade: DDM"
LblPoints.Text = "320 UCAS Points"
ElseIf GradeBoundaryPoints >= DDDMin And GradeBoundaryPoints <= DDDMax
Then
LblGrade.Text = "Overall Grade: DDD"
LblPoints.Text = "360 UCAS Points"
Else
LblGrade.Text = "Overall Grade: Fail"
End If
End If
End Sub

Private Sub CmdReset_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CmdReset.Click
PassUnitPoints = 0
MeritUnitPoints = 0
DestinctionUnitPoints = 0
GradeBoundaryPoints = 0
UCASPass = 0
UCASMerit = 0
UCASDestinction = 0
UnitCounter = 0
ProgressBar1.Value = Open_GUI.Units
TrBStatus.Value = Open_GUI.Units
CmdPass.Enabled = True
CmdMerit.Enabled = True
CmdDestinction.Enabled = True
LblPass.Text = "Passes"
LblMerit.Text = "Merits"
LblDistinction.Text = "Destinctions"
LblBoundaryPoints.Text = "0 Grade Boundry Points"
LblGrade.Text = "UCAS Grade: 00"
LblPoints.Text = "0 UCAS Points"
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
End
End Sub

Private Sub ResetToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs)
PassUnitPoints = 0
MeritUnitPoints = 0
DestinctionUnitPoints = 0
GradeBoundaryPoints = 0
UCASPass = 0
UCASMerit = 0
UCASDestinction = 0
UnitCounter = 0
ProgressBar1.Value = 0
TrBStatus.Value = 0
CmdPass.Enabled = True
CmdMerit.Enabled = True
CmdDestinction.Enabled = True
LblPass.Text = "Passes"
LblMerit.Text = "Merits"
LblDistinction.Text = "Destinctions"
LblBoundaryPoints.Text = "0 Grade Boundry Points"
LblGrade.Text = "UCAS Grade: 00"
LblPoints.Text = "0 UCAS Points"
End Sub

Private Sub AboutToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs)
End Sub

Private Sub FileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub
End Class

TESTING
TEST TEST DATA EXPECTED ACTUAL TEST RESULT
USED OUTPUT OUTPUT
CmdPass Allows user to Allowed user Works correctly
enter amount of to enter pass
pass grades grades
CmdMerit Allows user to Allowed user Works
enter amount of to enter merit
merit grades grades
CmdDistinctio Allows user to Allowed user Works
n enter amount of to enter
distinction grades distinction
grades
TrBStatus Shows status of Showed status Works
grade of grade
CmdCalculate Calculates user’s Calculated Works
total grades users total
grades

NOTE SAVER
The purpose of this program is to allow students to take down their own notes while in
class.

PROPERTIES:
CODE AND IMPLEMETATION OF PROGRAM:
Public Class Form1
Dim TheDate As DateTime
Dim TheTime As DateTime
Dim theResponse As String

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Timer1.Tick
TheDate = DateAndTime.Today
TheTime = DateAndTime.TimeOfDay
LblDate.Text = TheDate
LblTime.Text = TheTime
End Sub

Private Sub CmdExit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CmdExit.Click
theResponse = MsgBox("Do you want to quit?", MsgBoxStyle.Question + vbYesNo,
"Note Taker PRO")
If theResponse = vbYes Then
MsgBox("Goodbye", MsgBoxStyle.Exclamation, "Note Taker PRO")
Me.Close()
Else
MsgBox("Thanks", MsgBoxStyle.Exclamation, "Note Taker PRO")
End If
End Sub

Private Sub CmdSave1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CmdSave1.Click, CmdSave2.Click, CmdSave3.Click,
CmdSave4.Click, CmdSave5.Click, CmdSave6.Click, CmdSave7.Click
Dim SaveFile1 As New SaveFileDialog()
SaveFile1.DefaultExt = "*.txt"
SaveFile1.Filter = "Btec Files|*.txt"
If (SaveFile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) And
(SaveFile1.FileName.Length) > 0 Then
Select Case DirectCast(sender, Button).Name
Case CmdSave1.Name
RichTextBox1.SaveFile(SaveFile1.FileName,
RichTextBoxStreamType.PlainText)
Case CmdSave2.Name
RichTextBox2.SaveFile(SaveFile1.FileName,
RichTextBoxStreamType.PlainText)
Case CmdSave3.Name
RichTextBox3.SaveFile(SaveFile1.FileName,
RichTextBoxStreamType.PlainText)
Case CmdSave4.Name
RichTextBox4.SaveFile(SaveFile1.FileName,
RichTextBoxStreamType.PlainText)
Case CmdSave5.Name
RichTextBox5.SaveFile(SaveFile1.FileName,
RichTextBoxStreamType.PlainText)
Case CmdSave6.Name
RichTextBox6.SaveFile(SaveFile1.FileName,
RichTextBoxStreamType.PlainText)
Case CmdSave7.Name
RichTextBox7.SaveFile(SaveFile1.FileName,
RichTextBoxStreamType.PlainText)
End Select
End If
End Sub

Private Sub CmdOpen1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CmdOpen1.Click, CmdOpen2.Click, CmdOpen3.Click,
CmdOpen4.Click, CmdOpen5.Click, CmdOpen6.Click, CmdOpen7.Click
If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Dim sr As New System.IO.StreamReader(OpenFileDialog1.FileName)
MessageBox.Show(sr.ReadToEnd, "Note Taker PRO")
sr.Close()
End If
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub
End Class

TESTING

TEST TEST DATA EXPECTED ACTUAL TEST RESULT


USED OUTPUT OUTPUT
CmdOpen Opens the Opened the Works
students desired file the student
file wanted
CmdSave Saves the Saved the Works
student’s notes students notes
CmdExit Closes the Closes the Works
notesaver students
notesaver

You might also like