Anda di halaman 1dari 8

Unit 20 Assignment 3

Abdul Ali

UCAS Calculator

This program is designed to calculate the total UCAS points over two years for a
Btec national certificate.
Unit 20 Assignment 3
Abdul Ali

Input Expected output Actual Output Working Notes


(yes/no)
This is to test the drop It should have This works correctly and once you Yes Add a
down option to select different click the go button it would take you button to
the calculator. calculations so to the calculator. close the
each Btec should calculation
open when and also a
selected. button on
the
calculator to
take you
back to the
main menu.
Pass in deploma, 6 should be Yes None
award and certificate. added.
ElseIf ComboBox1.Text = "BTEC National Diploma" Then
Form4.PPPMin = 108
Form4.PPPMax = 131
Unit 20 Assignment 3 = 132
Form4.MPPMin
Abdul Ali Form4.MPPMax = 155
Form4.MMPMin = 156
This is theForm4.MMPMax
code for the Form1
= 179 (main menu)
Public ClassForm4.MMMMin
Form1 = 180
Form4.MMMMax
'my name is Abdul ALi' = 203
Form4.DMMMin = 204
'this is my ucas Calculator'
'Assignment 20.3 and =
Form4.DMMMax 227
18.2'
'Btec National Deploma 228
Form4.DDMMin = Software Year 1'
'stanmore Form4.DDMMax
college' = 251
Form4.DDDMin
Friend Units = 252
As Integer
Private Form4.DDDMax = 324
Sub Button1_Click(ByVal sender As System.Object, ByVal e As
Form4.Condition = 3
System.EventArgs) Handles Button1.Click
Units = 18
If ComboBox1.Text = "BTEC National Award" Then
Form4.Show()
Form2.PMin = 36
ElseIf ComboBox1.Text
Form2.PMax = 59 = "Please Select Course Type" Then
MsgBox("Please
Form2.MMin = 60Select Your Course Type", MsgBoxStyle.Exclamation,
"UCAS Calculator")
Form2.MMax = 83
End If
Form2.DMin = 84
End Sub Form2.DMax = 108
Form2.Condition = 1
Private Sub Label2_Click(ByVal
Units = 6 sender As System.Object, ByVal e As
System.EventArgs) Handles Label2.Click
Form2.Show()
ElseIf ComboBox1.Text = "BTEC National Certificate" Then
End Sub Form3.PPMin = 72
Form3.PPMax = 95
Private Sub Button2_Click(ByVal
Form3.MPMin = 96 sender As System.Object, ByVal e As
System.EventArgs) Handles
Form3.MPMax = 119Button2.Click
Close()
Form3.MMMin = 120
End Sub Form3.MMMax = 143
End Class Form3.DMMin = 144
Form3.DMMax = 167
Form3.DDMin = 168
Form3.DDMax = 216
Form3.Condition = 2
Units = 12
Form3.Show()

All the three calculators have the came coding only the code behind the
calculate button as award, diploma and certificate are not calculated the same.
Unit 20 Assignment 3
Abdul Ali

Award calculator:

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


System.EventArgs) Handles CmdCalculate.Click
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 Sub

Diploma calculator:
Private Sub CmdCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CmdCalculate.Click
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"
Certificate calculator:
ElseIf GradeBoundaryPoints >= DMMMin And GradeBoundaryPoints <= DMMMax
Then
Private Sub CmdCalculate_Click(ByVal sender As System.Object, ByVal e As
LblGrade.Text = "Overall Grade: DMM"
System.EventArgs) Handles CmdCalculate.Click
LblPoints.Text = "280 UCAS Points"
If GradeBoundaryPoints >= PPMin And GradeBoundaryPoints <= PPMax Then
ElseIf GradeBoundaryPoints >= DDMMin And GradeBoundaryPoints <= DDMMax
LblGrade.Text = "Overall Grade: PP"
Then
LblPoints.Text = "80 UCAS Points"
LblGrade.Text = "Overall Grade: DDM"
ElseIf GradeBoundaryPoints >= MPMin And GradeBoundaryPoints <= MPMax
LblPoints.Text = "320 UCAS Points"
Then
ElseIf GradeBoundaryPoints >= DDDMin And GradeBoundaryPoints <= DDDMax
LblGrade.Text = "Overall Grade: MP"
Then
LblPoints.Text = "120 UCAS Points"
LblGrade.Text = "Overall Grade: DDD"
ElseIf GradeBoundaryPoints >= MMMin And GradeBoundaryPoints <= MMMax
LblPoints.Text = "360 UCAS Points"
Then
Else
LblGrade.Text = "Overall Grade: MM"
LblGrade.Text = "Overall Grade: Fail"
LblPoints.Text = "160 UCAS Points"
End If
ElseIf GradeBoundaryPoints >= DMMin And GradeBoundaryPoints <= DMMax
End Sub
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 Sub
Unit 20 Assignment 3
Abdul Ali

Public Class Form2


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 Here is the code for Award: (the other
Friend DMMin As Integer calculator has the same code only the calculate
Friend DMMax As Integer
Friend DMMMin As Integerbutton code is different)
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
Unit 20 Assignment 3
Abdul Ali
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
TrBStatus.Value = TrBStatus.Value + 1
If TrBStatus.Value = TrBStatus.Maximum Then “this is the code for the
CmdPass.Enabled = False merit button”
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


Here I am declaring
System.EventArgs) all values
Handles CmdDestinction.Click
DestinctionUnitPoints
as string. = 18
GradeBoundaryPoints = GradeBoundaryPoints + DestinctionUnitPoints
UCASDestinction = UCASDestinction + 1
UnitCounter = UnitCounter + 1
TrBStatus.Value
Private = TrBStatus.Value + 1
Sub Button1_Click(ByVal
If TrBStatus.Value
sender As System.Object, ByVal = TrBStatus.Maximum
e As Then “this is the code for the
CmdPass.Enabled
System.EventArgs) Handles = False destionction button”
Button1.Click CmdMerit.Enabled = False
CmdDestinction.Enabled = False
Form1.Show()
End If
Close()
LblDistinction.Text = UCASDestinction & " Destinctions"
End Sub
End ClassLblBoundaryPoints.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 GradeBoundaryPoints
This is the back button >= 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"
Private Sub CmdPass_Click(ByVal
LblPoints.Text = "120 sender As System.Object,
UCAS Points" ByVal e button”
“the calculate As
System.EventArgs)
Else Handles CmdPass.Click
PassUnitPoints
LblGrade.Text= =6 "Overall Grade: Fail"
GradeBoundaryPoints
End If = GradeBoundaryPoints + PassUnitPoints
UCASPass = UCASPass + 1
UnitCounter = UnitCounter + 1
End Sub
TrBStatus.Value
Private = TrBStatus.Value
Sub CmdReset_Click(ByVal sender +As1 System.Object, ByVal e As
If TrBStatus.Value
System.EventArgs) = TrBStatus.Maximum Then
Handles CmdReset.Click “this is the pass button”
CmdPass.Enabled
PassUnitPoints = 0 = False
CmdMerit.Enabled
MeritUnitPoints = 0 = False
CmdDestinction.Enabled
DestinctionUnitPoints = 0 = False
End If
GradeBoundaryPoints = 0
LblPass.Text
UCASPass = 0 = UCASPass & " Passes" “the reset button”
LblBoundaryPoints.Text
UCASMerit = 0 = GradeBoundaryPoints & " Grade Boundary Points"
End Sub
UCASDestinction = 0
UnitCounter = 0
TrBStatus.Value = Form1.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
Unit 20 Assignment 3
Abdul Ali

The UCAS calculator before and after.

When I first made my UCAS calculator I had made all the forms and for some
reason my main menu when I click on e.g. award calculator it would take me
there but non of the buttons would work and the codes where right so there for I
decided to remake my calculator and here are some screen shoots of how my old
calculator and new one look like.
Unit 20 Assignment 3
Abdul Ali

My first ucas calculator I added an exit button as you can see and for the
calculators I added a back button and a reset button as I found it difficult to re
used the calculator so I added a reset button but then I released that someone
might of picked the wrong calculator and there for I added a back button.

I also added some design to it to make it more professional and also added the
college logo as it makes it more eyes catchy.

BEFORE AFTER

Anda mungkin juga menyukai