Student no.
:0726860      Documentation                              CP4012
                                                                      st
   Name: Altafhusain Khan                     Msc. Computer Science(1 Semister)
Week 4 - Application 2 – PSEUDOCODE (Student Grade Processing System)
   Declaring public variables
   Public Class Form3
   Begin
       Declare string array of two dimension studentData(4, 4)
       Declare integer totStdCount
   End
   End class
   On the click event of “Save Data” Command Button
   Begin
           Declare integers i, m
           For i=0 to the last element of an array
           If ith,0th element of an array is null or not empty then
                Get value of I in to m
                STOP
           End If
           Next
   read value of txtStdName.Text into mth,0th element of an array
   read value of txtTotMark.Text into mth,1st element of an array
   read value of txtAvgMark.Text into mth,2nd element of an array
   read value of txtGrade.Text into mth,3rd element of an array
           Declare object ctrl of Control class
           For each controls in current form’s control collection
                If Control type is TextBox Then
                    Empty the Textbox
                End If
           Next
           Add 1 to totStdCount
   Empty readonly textbox txtTotMark
   Empty readonly textbox txtAvgMark
   Empty readonly textbox txtGrade
   End
On the textchanged event of “Assessment4” Textbox
Begin
        Declare Integers totMarks, avgMark
        Add value of txtAssm1.Text, txtAssm2.Text, txtAssm3.Text, txtAssm4.Text to
totMarks
        read value of totMarks into txtTotMark.Text
        avgMark = totMarks / 4
        Get value of avgMark into txtAvgMark.Text
        #Check for the Grades
        If totMarks is greater than equals to 70 And totMarks is less than equals
to 100 Then
            Read “A” into txtGrade.Text
        ElseIf totMarks is greater than equals to 60 And totMarks is less than
equals to 69 Then
            Read “B” into txtGrade.Text
                                                                                  1/5
   Student no.:0726860       Documentation                                 CP4012
                                                                         st
   Name: Altafhusain Khan                         Msc. Computer Science(1 Semister)
        ElseIf totMarks is greater than      equals to 50 And totMarks is less than
equals to 59 Then
            Read “C” into txtGrade.Text
        ElseIf totMarks is greater than      equals to 40 And totMarks is less than
equals to 49 Then
            Read “D” into txtGrade.Text
        ElseIf totMarks is greater than      equals to 30 And totMarks is less than
equals to 39 Then
            Read “E” into txtGrade.Text
        ElseIf totMarks is greater than      equals to 0 And totMarks is less than
equals to 29 Then
            Read “F” into txtGrade.Text
        End If
End
on the click event of “Total no. of students” command button
Begin
      Display “Total No. of students =” & value of totStdCount
End
on the click event of “Highest Marks” command button
Begin
          Declare integers i, m, HigMarks, marks, hMarkCount
          Declare String stdNm
If first element of array is not null or not empty then
For m=0 to the last element of an array
      If second element of array is not null or not empty then
             read value of second element of array into marks
      End If
      Initialize: hMarkCount with 0
      For i=0 to the last element of an array
        If first element of array is not null or not empty then
          If ith,1st element of an array is less than equals to marks then
                   Add 1 to hMarkCount
          End If
        End If
        Next
        If value of hMarkCount equals to totStdCount Then
               read value of marks into HigMarks
               read value of mth,0 element of an array into stdNm
        stop
        End If
        Next
        Display "Name of student =" & value of stdNm & " with highest
        marks =" & value of HigMarks
        End If
End
On the click event of “Lowest marks” Command Button
Begin
        Declare integers i, m, lwMarks, marks, lMarkCount
        Declare string stdNm
                                                                                      2/5
   Student no.:0726860      Documentation                             CP4012
                                                                    st
   Name: Altafhusain Khan                    Msc. Computer Science(1 Semister)
If first element of array is not null or not empty then
For m=0 to the last element of an array
         If mth,1st element of an array is not null or not empty then
              read mth,1st element’s value of an array in to marks
           End If
           initialise lMarkCount with 0
For i=0 to the last element of an array
If ith,1st element of an array is not null or not empty Then
 If ith,1st element’s value of an array is less than equals to marks Then
                Add 1 to lMarkCount
 End If
End If
Next
       If value of lMarkCount equals to 1 Then
       read value of marks into lwMarks
       read value of mth,0th element’s value of an array in to stdNm
       STOP
       End If
Next
Display "Name of student =" & value of stdNm & " with lowest marks =" & value of
lwMarks
End If
End
On the click event of “No. of Students gaining Each Grade” command Button
Begin
             Declare integers i, m, gradeCount, gA, gB, gC, gD, gE, gF
             Declare strings stdNm, grade
   If the first element of an array is not Null or Empty Then
For m=0 to the last element of an array
If mth,3rd element of an array is not null or not empty Then
       read value of mth,3rd element’s value of an array in to grade
                          Initialize gradeCount with 0
                          If value of grade equals to "A" Then
                              Add 1 to gA
                          End If
                          If grade = "B" Then
                              Add 1 to gB
                          End If
                          If value of grade equals to "C" Then
                              Add 1 to gC
                          End If
                          If value of grade equals to "D" Then
                              Add 1 to gD
                          End If
                          If value of grade equals to "E" Then
                              Add 1 to gE
                          End If
                          If value of grade equals to "F" Then
                              Add 1 to gF
                          End If
                      End If
                 Next
   Display "Grade A=" & value of gA & next line & "Grade B=" & value of gB & next
   line & "Grade C=" & value of gC & next line & "Grade D=" & value of gD & next
                                                                                 3/5
   Student no.:0726860         Documentation                                  CP4012
                                                                               st
   Name: Altafhusain Khan                            Msc. Computer Science(1 Semister)
   line & "Grade E=" & value of gE & next line & "Grade F=" & value of gF & next
   line)
   End If
End
On the click event of “Average Marks” command Button
Begin
           Declare Integers i, totMarksCount
    For i=0 to the last element of an array
    If ith,1st element of an array is not null or not empty Then
             Add ith,1st element’s value of an array to totMarksCount
    End If
    Next
      Display "Average marks of students is = " & value of (totMarksCount /
    totStdCount)
End
Forms Designing and Controls Size, Tab Index
                            Students Marks, Grade Processing System
                                                                Tab Index 0
                                 Name
                                                                Tab Index 1
                         Assessment1
                                                                Tab Index 2
                         Assessment2
                                                                Tab Index 3
                         Assessment3
                                                                Tab Index 4
                         Assessment4
                         Total Marks
                       Average Marks
                                                                              Tab Index 11
                                Grade
                                                                                     Quit
                                           Save Data        Tab Index 5
        Total No. of     Highest       Lowest      No. of students gaining          Average
         Students         Marks        Marks             each grade                  Marks
       Tab Index 6     Tab Index 7   Tab Index 8        Tab Index 9           Tab Index 10
   Controls used for the design are:
   Label controls, Text Box controls, Command button controls
                                                                                              4/5
Student no.:0726860       Documentation                              CP4012
                                                                   st
Name: Altafhusain Khan                      Msc. Computer Science(1 Semister)
Size of Label controls is = 79 (Width), 13 (Height)
Size of Text Box controls is = 100 (Width), 20 (Height)
Size of Command Button controls = (Width, Height)
Total No. of Students           = (75, 37)
Highest Marks                   = (78, 37)
Lowest Marks                    = (75, 37)
No. of students gaining each
  grade                         = (111, 37)
Average Marks                   = (75, 37)
Quit                            = (75, 37)
Assumptions:
- Input validation should be made on each input controls
- Error handling should be done
- Proper data display should be create so that all the details of the student
can be viewed
Test Data for the program:
Student Name       john   Kevin   martin
Assessment1        22     12      20
Assessment2        21     14      21
Assessment3        23     16      23
Assessment4        25     16      21
Total Marks        91     58      85
Average Marks      23     14      21
Grades             A       C      A
Command Buttons click’s   results:
Tot no. of students       = 3
Highest marks             = name of student john with highest marks 91
Lowest marks              = name of student kevin with highest marks 58
No. of students gaining   each grade = GRADE A=2, GRADE C=1
Average Marks             = 78
Evaluation:
   -   The program does fulfill the purpose accurately.
   -   The program is completely error free.
   -   The program is fully stable for small volume of data.
   -   It is advisable to use database for large amount of data.
   -   Final product is completely reliable.
   -   The program is fully documented.
   -   The program is not secured, security aspects have not been considered
       yet.
   -   Error handling and Input validations has to be considered.
                                                                                5/5