P5 New Version

Embed Size (px)

Citation preview

  • 8/9/2019 P5 New Version

    1/16

    Masood Mohammad unit 18

    This is the first part which shows

    how to create the program. This

    program is about calculating the

    UCAS point for university.

    Each of these program contain

    different job.

    Once you click on pass the ruler

    will move one step to the right, so merit and destination are work the same just click it and itwill work.

    After you choose

    your grade then click

    on calculate UCAS

    and it will calculate

    it and it will show

    either it pass, merit

    or distinction

  • 8/9/2019 P5 New Version

    2/16

    Masood Mohammad unit 18

    Properties for UCAS point

    Its coding for UCAS calculater.

    PublicClass Form1 Dim PassUnitPoints AsInteger Dim MeritUnitPoints AsInteger Dim DestinctionUnitPoints AsInteger Dim GradeBoundaryPoints AsInteger

  • 8/9/2019 P5 New Version

    3/16

    Masood Mohammad unit 18

    Dim UCASPass AsInteger Dim UCASMerit AsInteger Dim UCASDestinction AsInteger Dim UnitCounterAsInteger Friend PMin AsInteger Friend PMax AsInteger

    Friend PPMin AsInteger Friend PPMax AsInteger Friend PPPMin AsInteger Friend PPPMax AsInteger Friend MPMin AsInteger Friend MPMax AsInteger Friend MPPMin AsInteger Friend MPPMax AsInteger Friend MMPMin AsInteger Friend MMPMax AsInteger Friend MMin AsInteger Friend MMax AsInteger Friend MMMin AsInteger Friend MMMax AsInteger Friend MMMMin AsInteger Friend MMMMax AsInteger Friend DMin AsInteger Friend DMax AsInteger Friend DMMin AsInteger Friend DMMax AsInteger Friend DMMMin AsInteger Friend DMMMax AsInteger Friend DDMMin AsInteger Friend DDMMax AsInteger Friend DDMin AsInteger Friend DDMax AsInteger Friend DDDMin AsInteger

    Friend DDDMax AsInteger Friend Condition AsInteger

    PrivateSub CmdPass_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles CmdPass.Click

    PassUnitPoints = 6GradeBoundaryPoints = GradeBoundaryPoints + PassUnitPointsUCASPass = UCASPass + 1UnitCounter = UnitCounter + 1TrBStatus.Value = TrBStatus.Value + 1

    IfTrBStatus.Value = TrBStatus.Maximum ThenCmdPass.Enabled = FalseCmdMerit.Enabled = False

    CmdDestinction.Enabled = False EndIfLblPass.Text = UCASPass & " Passes"LblBoundaryPoints.Text = GradeBoundaryPoints & " Grade Boundary Points"

    EndSub

    PrivateSub CmdMerit_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles CmdMerit.Click

    MeritUnitPoints = 12GradeBoundaryPoints = GradeBoundaryPoints + MeritUnitPointsUCASMerit = UCASMerit + 1UnitCounter = UnitCounter + 1TrBStatus.Value = TrBStatus.Value + 1

    IfTrBStatus.Value = TrBStatus.Maximum ThenCmdPass.Enabled = FalseCmdMerit.Enabled = False

  • 8/9/2019 P5 New Version

    4/16

  • 8/9/2019 P5 New Version

    5/16

    Masood Mohammad unit 18

    ElseIfGradeBoundaryPoints >= MPPMin And GradeBoundaryPoints = MMPMin And GradeBoundaryPoints = MMMMin And GradeBoundaryPoints = DMMMin And GradeBoundaryPoints = DDMMin And GradeBoundaryPoints = DDDMin And GradeBoundaryPoints

  • 8/9/2019 P5 New Version

    6/16

    Masood Mohammad unit 18

    CmdPass.Enabled = TrueCmdMerit.Enabled = TrueCmdDestinction.Enabled = TrueLblPass.Text = "Passes"LblMerit.Text = "Merits"LblDistinction.Text = "Destinctions"

    LblBoundaryPoints.Text = "0 Grade Boundry Points"LblGrade.Text = "UCAS Grade: 00"LblPoints.Text = "0 UCAS Points"

    EndSub

    PrivateSub AboutToolStripMenuItem1_Click( ByVal senderAs System.Object, ByVal e AsSystem.EventArgs) EndSub

    PrivateSub Form1_Load(ByVal senderAs System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

    EndSub

    PrivateSub ProgressBar1_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    EndSub

    PrivateSub MenuStrip1_ItemClicked(ByVal senderAs System.Object, ByVal e AsSystem.Windows.Forms.ToolStripItemClickedEventArgs)

    EndSub

    PrivateSub Back_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs) HandlesBack.Click

    Open_GUI.Show()Close()

    EndSub

    PrivateSub LblPoints_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles LblPoints.Click

    EndSub

    PrivateSub LblMerit_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles LblMerit.Click

    EndSub

    PrivateSub LblGrade_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)

    Handles LblGrade.Click

    EndSub

    PrivateSub LblBoundaryPoints_Click(ByVal senderAs System.Object, ByVal e AsSystem.EventArgs) Handles LblBoundaryPoints.Click

    EndSub

    PrivateSub TrBStatus_Scroll(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles TrBStatus.Scroll

    EndSub

    PrivateSub LblDistinction_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles LblDistinction.Click

  • 8/9/2019 P5 New Version

    7/16

    Masood Mohammad unit 18

    EndSub

    PrivateSub LblBanner_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles LblBanner.Click

    EndSub

    PrivateSub LblPass_Click(ByVal senderAs System.Object, ByVal e As System.EventArgs)Handles LblPass.Click

    EndSubEndClass

    Note saver

    This program show the note that student can take for each unit and also they can save andopen it.

  • 8/9/2019 P5 New Version

    8/16

    Masood Mohammad unit 18

    Once you write the note you can save it and open it at anytime.

    Properties

  • 8/9/2019 P5 New Version

    9/16

    Masood Mohammad unit 18

    Coding for note saver

    PublicClass Form1 Dim TheDate As DateTime

    Dim TheTime As DateTime Dim theResponse AsString

    PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Timer1.Tick

    TheDate = DateAndTime.TodayTheTime = DateAndTime.TimeOfDayLblDate.Text = TheDateLblTime.Text = TheTime

    EndSub

    PrivateSub CmdExit_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles CmdExit.Click

    theResponse = MsgBox("Do you want to quit?", MsgBoxStyle.Question +vbYesNo, "Note Taker PRO") If theResponse = vbYes Then

  • 8/9/2019 P5 New Version

    10/16

  • 8/9/2019 P5 New Version

    11/16

    Masood Mohammad unit 18

    EndSub

    PrivateSub RichTextBox4_TextChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles RichTextBox4.TextChanged

    EndSub

    EndClass

    Testing the UCAS calculator and Note Saver

    UCAS Calculator

  • 8/9/2019 P5 New Version

    12/16

    Masood Mohammad unit 18

    Qualification# of

    Passes

    # of

    Merits

    # of

    Distinctions

    Expected

    Outcome

    Actual

    Outcome

    Pass/F

    ailNotes

    BTEC National

    Diploma6 4 2

    TotalPoints=120UCAS Points:120 Overall

    Grade:PPP

    TotalPoints=120UCAS Points:120

    OverallGrade: PPP

    Pass

    No mistakes

    3 7 2

    TotalPoints=138UCAS Points:160Overall Grade:MPP

    TotalPoints=138UCAS Points:160OverallGrade: MPP

    Pass

    No mistakes

    5 2 5

    TotalPoints=144UCAS Points:160

    Overall Grade:MPP

    TotalPoints=144UCAS Points:160

    OverallGrade: MPP

    Pass

    No mistakes

    3 2 7

    TotalPoints=186UCAS Points:200Overall Grade:MMP

    TotalPoints=186UCAS Points:200OverallGrade: MMP

    Pass

    No mistakes

    2 2 8

    TotalPoints=180UCAS Points:240

    Overall Grade:MMM

    TotalPoints=180UCAS Points:240

    OverallGrade: MMM

    Pass

    No mistakes

    Qualification # of

    Passes

    # of

    Merits

    # of

    Distinctions

    Expected

    Outcome

    Actual

    Outcome

    Pass/F

    ailNotes

    BTEC National

    Certifacate

    4 4 4 TotalPoints=140UCAS Points:

    200 OverallGrade:DM

    TotalPoints=140UCAS Points:

    200OverallGrade: DM

    Pass No

    mistakes

    6 3 3 TotalPoints=126UCAS Points:160Overall Grade:MM

    TotalPoints=138UCAS Points:160OverallGrade: MM

    Pass No

    mistakes

    5 6 5 TotalPoints=192UCAS Points:

    240Overall Grade:DD

    TotalPoints=192UCAS Points:

    240OverallGrade: DD

    Pass No

    mistakes

    3 2 7

    TotalPoints=186UCAS Points:200Overall Grade:MMP

    TotalPoints=186UCAS Points:200Overall

    Grade: MMP

    Pass

    No

    mistakes

    4 4 4

    TotalPoints=144UCAS Points:

    200Overall Grade:DD

    TotalPoints=144UCAS Points:

    200OverallGrade: DD

    Pass

    No

    mistakes

    Qualification# of

    Passes

    # of

    Merits

    # of

    Distinctions

    Expected

    Outcome

    Actual

    Outcome

    Pass/F

    ailNotes

    BTEC National

    Award

    9 2 1 TotalPoints=96UCAS Points:120 OverallGrade:D

    TotalPoints=96UCAS Points:120OverallGrade: D

    Pass

    No mistakes

    7 3 2 Total

    Points=144UCAS Points: 0Overall Grade:Fail

    Total

    Points=144UCAS Points:0OverallGrade: MPP

    Fail

    No mistakes

    11 1 1 TotalPoints=78UCAS Points:80Overall Grade:M

    TotalPoints=78UCAS Points:80OverallGrade:M

    Pass

    No mistakes

    8 2 2 TotalPoints=108UCAS Points:120Overall Grade:D

    TotalPoints=108UCAS Points:120Overall

    Grade:D

    Pass

    No mistakes

    9 2 1 TotalPoints=84UCAS Points:120Overall Grade:

    D

    TotalPoints=84UCAS Points:120Overall

    Grade:D

    Pass No mistakes

  • 8/9/2019 P5 New Version

    13/16

    Masood Mohammad unit 18

    M2: Improve the user interface and functionality of an event

    driven program based on a formal review

    To improve my program I have to compare it to other

    program, I need to create it more general to show more

    impression and also I need to change the background that

    everyone can see it properly. To improve it more I have to

    give to each unit different page and different layout.

    The other way to improve my program more buttons which

    are clear, stop, resume and also important button is to go back

    to original page

    I can improve it by adding browse button and also I can put

    MP3 to make it more interest.

  • 8/9/2019 P5 New Version

    14/16

    Masood Mohammad unit 18

    To make it more attractive I have to add sound at the

    background and make it more professional.

    Improvement to my program which is below.

    I made improvement which I added browser, MP3 and also I have added my name.

    The other improvement I have made, is I have changed the colour of my program and also i

    create clear button which if there is any error in text than rather than going Exit button to exit

    the whole program can go to clear and it will clear the text only.

  • 8/9/2019 P5 New Version

    15/16

    Masood Mohammad unit 18

    I think the improvement I have made is more interested than the previous one, because at the

    same time doing the note they can also Liston to music, the browser I have create is which

    you can go to any website you want to like any useful website.

    M3: Compare the use and effectiveness of global and local variables

    Global

    A global variable is that accessible in every scope. Interaction mechanisms with

    global variable are called global environment.

    Global variable are used extensively to pass information between sections of code

    that it don't share it. When a function is defined certain variables used for storing

    values are incorporated inside the function. These variables are found and used only

    inside these functions. Since functions are separate from the main code, it's

    advisable to use variables that are initialized only when a function is called and die

    when the execution comes out of the function. Variables that exist only inside a

    function are called Local variables.

    #include usingnamespace std;

    int main (){ // declaring variables: int a, b; int result;

    // process:

    a = 5;b = 2;a = a + 1;

  • 8/9/2019 P5 New Version

    16/16

    Masood Mohammad unit 18

    result = a - b;

    // print out the result:cout