You are on page 1of 92

St.

Andrew Preparatory School

Student Report Generator

Rushawn White

1000053501

100005

Ardenne High School

Ms Andrienne Jones

Computer Science Unit 2


Table of Contents
Requirements Specification.....................................................................................................3

Problem Definition.................................................................................................................4

Functional Requirements.......................................................................................................6

Non-Functional Requirements...............................................................................................7

Techniques of Analysis Used.................................................................................................8

Data Flow Diagrams (DFD).................................................................................................11

Context Level Diagram....................................................................................................11

Level 1 Diagram...............................................................................................................12

Entity Relationship Diagram................................................................................................13

Design Specification...............................................................................................................14

HIPO Chart...........................................................................................................................15

Justification of User Interface..............................................................................................17

User Interface Design...........................................................................................................18

Data Structures.....................................................................................................................24

Pseudocode...........................................................................................................................25

Coding and Testing................................................................................................................45

C Code..................................................................................................................................46

Test Plan...............................................................................................................................72

Test Results..........................................................................................................................85
Requirements

Specification

3|Page
Problem Definition
The St. Andrew Preparatory is a school that is located on Cecelio Avenue, Kingston

10 and the contact number of the school is 1876-920-5728. It was founded in 1930 by

Presbyterian Church of Jamaica and Wesleyan Methodist Church. The school is broken down

into two groups: the lower department from grades K1 to 2, and the upper department from

grades 3 to 6. In total there are 8 teachers working with approximately 80 students in the

lower department and 12 teachers working with approximately 120 students in the upper

department. On a normal school day, school progressing from 8:00am to 1:00pm for the

lower department and 8:00am to 2:00pm for the upper department. In the school’s curriculum

they offer Mathematics, English, Science, Social Studies, Art, Physical Education, Drama,

Music, and Chess.

Problem

At the school to generate reports the teachers would have to manually write reports

using a pen, calculator and paper for each individual student. Teachers have reported writing

reports to be tedious and have sometimes miscalculated the grades which would lead to a

misrepresentation of students’ performances. Accompanying this, they have reported cases

where the reports they have written were damaged, misplaced or tarnished. It has also been

reported by the teachers that grade books have gone missing and thus important grades are

lost and cannot be used.

Solution

To solve these problems, a system would be put in place to eliminate written reports

and rather implement digital reports that may be printed, viewed and stored on a device. This

4|Page
system will ensure averages are accurately calculated and student’s information are properly

stored and saved for future use.

5|Page
Functional Requirements
The system should be able to:

 Allow the admin to enter the names of the teachers of each class as well as the names,

ages and gender of each student from each class.

 Generate unique identification numbers (IDs) for each teacher as well as each student.

 Accept the grades for each subject of a student

 Calculate the averages of each subject of the student, as well as the overall average of

the student.

 Calculate the overall average of each subject of a class, as well as the overall average

of the class.

 Output the report of a student showing the full name, age, gender, ID number, name

of class and teacher, year and term of report, average grade of each subject, and the

overall average of the student.

 Output the report of a class showing the full name of the teacher, ID number of the

teacher, the number of students, year and term of report, overall average of each

subject of the class, the overall average of the class, the student with the highest

average for each subject, and the student with the highest overall average.

 Store reports on files.

6|Page
Non-Functional Requirements
 The reports should be printable.

 The system should be protected with a password.

 The system should allow teachers to easily interact with it.

 Only teachers are allowed to interact with the program.

7|Page
Techniques of Analysis Used
The techniques of analysis used to gather data about this problem are an interview and

reviewing internal documents.

Interview

A closed interview was conducted with a senior teacher from the school. The entire

interview lasted an hour at the institution. The justification for using this technique was to get

a first-hand interpretation of how the original system would take place. It also helps to outline

the problems with the current system as well as what they would like to see be improved in

their system.

Interview Questions

1. How are grades recorded at school?


2. How often are mistakes made when recording grades?
3. Do you have difficulties writing reports for all your students?
4. If so, explain the difficulties you may have.
5. Do you have a problem with the current report writing system?
6. If so, what you recommend to improve the current system that is in place?

Reviewing Internal Documents

Internal documents such as templates of the report used when writing reports and

examples of completed reports were reviewed. It was discovered that from the examples of

the reports there are places where values for averages are crossed out and replaced with new

averages due to miscalculation which makes the presentation overall untidy. The justification

for this technique is to see first-hand how the reports are structured and made and to

understand how serious the problems outlined in the interview were by reviewing examples.

Internal Documents

8|Page
9|Page
10 | P a g e
Data Flow Diagrams (DFD)

Context Level Diagram

11 | P a g e
Level 1 Diagram

12 | P a g e
Entity Relationship Diagram

13 | P a g e
Design Specification

14 | P a g e
HIPO Chart

ScanSchool – To retrieve school (classes and students) information stored on the “School

Database.txt” file.

ListSelect – To generate a menu showing a list of options. This menu can be interacted with

by used the W (Up), S (Down), and Enter keys to scroll through the menu and select an

option respectively.

ViewGrades – This creates a dynamic table of grades of all subjects for a student that the

teacher can view once selected.

15 | P a g e
AddGrades – This allows the teacher to add grades for a subject for a student they have

selected.

RemoveGrades – This allows the teacher to remove grades for a subject for a student they

have selected.

StudentReport – To generate a student report showing the student’s personal information, the

averages of each subject, the ratings issued for each average as well as the overall average

achieved by the student. This function also prints the student report on a personalized file

(Named after the student) to be printed.

Loop – This prints a symbol to the screen for a certain number of times

Clear – This pauses the screen indefinitely until a key is enter, in which case will clear the

entire screen.

UpdateSchool – To clear the “School Database.txt” file and print the updated school’s

(classes and students) information stored to the “School Database.txt” file.

16 | P a g e
Justification of User Interface
After analysing the problem, the most appropriate interface that was chosen to be used

were a combination of Graphical User Interface (GUI), form-fill, and menu driven interfaces.

This combination of interfaces were selected as teachers will be able to easily interact with

the system (user friendliness) and reports can be graphically represented after being

generated.

17 | P a g e
User Interface Design

18 | P a g e
19 | P a g e
20 | P a g e
21 | P a g e
22 | P a g e
23 | P a g e
Data Structures
The data structures that were utilized in the algorithm are:

1. Nested array structures:

These were used to store the records of all classes in the school, the records students

in each class, the records of subjects for each student, and the record of grades for

each subject.

2. String Arrays

These were used to store the names of the subjects that are taught in the school as well

as to store the list of options that will be printed to the screen.

3. Search Function

This was used to search for a class that was being selected using the teacher’s

password

4. Files

These were used to store the information about all the class in the school as well as to

store student report after they were generated

5. String Pointers

These were used to pass array of strings, which hold a list of options, to the ListSelect

function so that they can be printed to the screen.

24 | P a g e
Pseudocode
Structure Subject

grade[20],gtot as integer

End Subject

Structure Student

name as string

sex as character

age as integer

sub[10] as Subject Instance

End Student

Structure Class

cname,tname,password as string

idnum,stot as integer

stud[100] as Student Instance

End

Declare:

sprint[100],hmale,hfemale as Student Instance

cla[100],ctemp as Class Instance

subject[100],option[100] as string

25 | P a g e
ctot,i,j,k,l,m,n,o as integer

plist[100],list[100] as string

rep as Windows SYSTEMTIME

subject={"","Mathematics","English_Language","Science","Social_Studies","Art","Physical

_Education","Drama","Music","Chess"}

option={"","View Grades","Add Grades","Remove Grades","Student Report","Main Menu"}

Function main

Begin

Declare found as integer

Declare pass as string

found=0

Call ScanSchool

Write"Enter your password to continue (ID Number+Last Name Ex: 10076Brown): "

Read pass

For i=1 to ctot do

If pass=cla[i].password Then

found=found+1

End For

End If

End For

26 | P a g e
If found = 1 Then

Repeat

For j=1 to cla[i].stot do

list[j]=cla[i].stud[j].name

plist[j]=list[j]

End For

list[j]="Exit"

plist[j]=list[j]

j=ListSelect(plist,cla[i].stot+1,"Please select one of the students below

or exit:")

If j<>cla[i].stot+1 Then

Repeat

m= Call ListSelect(option,5,"Please select one of the

options below:")

Do Case

case m=1

Call ViewGrades

case m=2

Call AddGrades

case m=3

27 | P a g e
Call RemoveGrades

break

case m=4

Call StudentReport

End Case

Until m=5

End If

Until j=cla[i].stot+1

Write"Thank you for using the St. Andrew Prep School program!"

Call UpdateSchool

Else

Write"The passsword you entered is invalid!Shutting down program..."

End If

End

Procedure ScanSchool

Begin

Get the system time and store in rep

If rep.wMonth>=9 AND rep.wMonth<=12 Then

term=1

Else If time.wMonth>=1 AND time.wMonth<=4 Then

28 | P a g e
term=2

Else

term=3

End If

If "School Database.txt" was not found

Write"Welcome admin!The database is empty!Please fill out the form below:

"

Write"Total classes: "

Read ctot

For i=1 to ctot do

Write"Name of the class (Ex. 6H: "

Read cla[i].cname

Write"last name of the teacher (Ex. Brown OR James-Jackson: "

Read cla[i].tname

Write"Total students in class: "

Read cla[i].stot

cla[i].idnum=10000+i

Write"Teacher ID: ",cla[i].idnum

convert cla[i].idnum to string and store in ctemp.password

ctemp.password=ctemp.password+cla[i].tname

29 | P a g e
cla[i].password=ctemp.password

For j=1 to cla[i].stot do

Write"Form for student #%d:First and Last name (Ex. John

Brown: ",j

Read cla[i].stud[j].name

Write"Age (Ex. 10: "

Read cla[i].stud[j].age

Write"Sex (M OR F: "

Read cla[i].stud[j].sex

Write cla[i].stud[j].name," added to class!"

End For

Write"Class ",cla[i].cname," was added to school database!"

End For

Call UpdateSchool

Write" __________________________________

____________________________________ "

Write"|_Teacher______________|_Class_|_ID_Number_|

_Password__________________|"

Write"| | | | |"

For i=1 to ctot do

30 | P a g e
Write"| ",cla[i].tname," | ",cla[i].cname," | ",cla[i].idnum," |

",cla[i].password," |"

End For

Write"|______________________|_______|___________|

___________________________|"

Write"Database Complete!"

Else

Read ctot from "School Database.txt"

For i=1 to ctot do

Read

cla[i].cname,cla[i].tname,&cla[i].idnum,cla[i].password,&cla[i].stot

from "School Database.txt"

For j=1 to cla[i].stot do

Read cla[i].stud[j].name from "School Database.txt"

Read cla[i].stud[j].sex,&cla[i].stud[j].age from "School

Database.txt"

For k=1 to 9 do

Read cla[i].stud[j].sub[k].gtot from "School

Database.txt"

For l=1 to cla[i].stud[j].sub[k].gtot do

31 | P a g e
Read cla[i].stud[j].sub[k].grade[l] from "School

Database.txt"

End For

End For

End For

End For

Close "School Database.txt"

End If

End ScanSchool

Procedure UpdateSchool

Begin

Open "School Database.txt" in write mode

Write ctot to "School Database.txt"

For i=1 to ctot do

Write cla[i].cname,cla[i].tname,cla[i].idnum,cla[i].password,cla[i].stot to

"School Database.txt"

For j=1 to cla[i].stot do

Write cla[i].stud[j].name,cla[i].stud[j].sex,cla[i].stud[j].age to "School

Database.txt"

For k=1 to 9 do

32 | P a g e
Write cla[i].stud[j].sub[k].gtot to "School Database.txt"

If cla[i].stud[j].sub[k].gtot>0 Then

For l=1 to cla[i].stud[j].sub[k].gtot do

Write cla[i].stud[j].sub[k].grade[l] to "School

Database.txt"

End For

End If

End For

End For

End For

Close "School Database.txt"

End UpdateSchool

Procedure ViewGrades

Begin

Declare hightotgrade as integer

hightotgrade=0

For k=1 to 9 do

If cla[i].stud[j].sub[k].gtot>hightotgrade Then

hightotgrade=cla[i].stud[j].sub[k].gtot

End If

33 | P a g e
End For

If hightotgrade>0 Then

Write cla[i].stud[j].name

Write" ____________________"

Call Loop(1,hightotgrade,"_______")

Write"| |"

Call Loop(1,hightotgrade," |"

Write"| Subject Name |"

For l=1 to hightotgrade do

Write" Gr ",l," |"

End For

Write"|____________________|"

Loop(1,hightotgrade,"______|")

Write"| |"

Loop(1,hightotgrade," |")

For k=1 to 9 do

Write"| ",subject[k]," |"

For l=1 to hightotgrade do

Write" ",cla[i].stud[j].sub[k].grade[l]," |"

End For

34 | P a g e
End For

Write"|____________________|"

Loop(1,hightotgrade,"______|")

Else

Write cla[i].stud[j].name," has no grades!"

End If

End ViewGrades

Procedure AddGrades

gadd,gstart,gend as integer

o= Call ListSelect(subject,9,"Please select one of the subjects you are adding grades

for below:")

Write"Enter the amount of grades you are adding: "

Read gadd

If gadd>0 Then

gstart=cla[i].stud[j].sub[o].gtot+1

gend=cla[i].stud[j].sub[o].gtot+gadd

For n=gstart to gend do

cla[i].stud[j].sub[o].gtot=cla[i].stud[j].sub[o].gtot+1

Write"Grade #",n,": "

Read cla[i].stud[j].sub[o].grade[n]

35 | P a g e
Call ViewGrades

End For

Write"Grades added to database!"

Else

Write"The total grades entered is invalid (less than 1.Please try again!"

End If

End AddGrades

Procedure RemoveGrades

Begin

gremove as integer

k= Call ListSelect(subject,9,"Please select one of the subjects you are removing a

grade for below:")

If cla[i].stud[j].sub[k].gtot>0 Then

For l=1 to cla[i].stud[j].sub[k].gtot do

convert cla[i].stud[j].sub[k].grade[l] to string and store in list[l]

plist[l]=list[l]

End For

l= Call ListSelect(plist,cla[i].stud[j].sub[k].gtot,"Please select the grade you

are removing:"

For n=l to cla[i].stud[j].sub[k].gtot-1 do

36 | P a g e
cla[i].stud[j].sub[k].grade[n]=cla[i].stud[j].sub[k].grade[n+1]

End For

cla[i].stud[j].sub[k].gtot=cla[i].stud[j].sub[k].gtot-1

Write"Grade was removed!"

Else

Write subject[k]," has no grades!"

End If

End RemoveGrades

Procedure StudentReport

Begin

file,finame as string

oaverage,saverage[100] as integer

oaverage=0

For k=1 to 9 do

saverage[k]=0

If cla[i].stud[j].sub[k].gtot>0 Then

For l=1 to cla[i].stud[j].sub[k].gtot do

saverage[k]=saverage[k]+cla[i].stud[j].sub[k].grade[l]

End For

saverage[k]=saverage[k]/cla[i].stud[j].sub[k].gtot

37 | P a g e
End If

oaverage=oaverage+saverage[k]

End For

oaverage=oaverage/9

finame=cla[i].stud[j].name

finame=finame+".txt"

Open finame in write mode

Write"

_____________________________________________________________________

_________________________________" to finame

Write"| |" to finame

Write"| St. Andrew Preparatory School |"

to finame

Write"| School Report |" to

finame

Write"| |" to finame

Write"| Name of Child: ",cla[i].stud[j].name"

______________________________________ |" to finame

Write"| Class Teacher: ",cla[i].tname," |_____________RATINGS

USED_____________| |" to finame

38 | P a g e
Write"| Form: ",cla[i].cname," | |

|" to finame

Write"| Age: ",cla[i].stud[j].age," | E - Excellent S -

Satisfactory | |" to finame

Write"| No. of pupils in class: ",cla[i].stot," | V - Very Good N -

Needs Improvement | |" to finame

Write"| Final Grade: ",oaverage,"% | G - Good U-

Unsatisfactory | |" to finame

Write"| Term ",term," ",rep.wYear," |

______________________________________| |" to finame

Write"|

_____________________________________________________________________

_________________________________|" to finame

Write"|

_____________________________________________________________________

_________________ |" to finame

Write"| | | | | | | | | | |" to finame

Write"| | Subject Name | Average | E | V | G | S | N | U |

|" to finame

Write"| |____________________________________|_____________|_____|

_____|_____|_____|_____|_____| |" to finame

39 | P a g e
Write"| |____________________________________|_____________|_____|

_____|_____|_____|_____|_____| |" to finame

For k=1 to 9 do

Write"| | | | | | | | | | |" to

finame

Write"| | ",subject[k]," | ",saverage[k]," |" to finame

For m=1 to 6 do

If m=1 AND saverage[k]>=90 Then

Write" * |"

Else If m=2 AND saverage[k]>=80 AND saverage[k]<90 Then

Write" * |"

Else If m=3 AND saverage[k]>=70 AND saverage[k]<80 Then

Write" * |"

Else If m=4 AND saverage[k]>=60 AND saverage[k]<70 Then

Write" * |"

Else If m=5 AND saverage[k]>=50 AND saverage[k]<60 Then

Write" * |"

Else If m=6 AND saverage[k]<50 Then

Write" * |"

Else

40 | P a g e
Write" |"

End If

End For

Write" |" to finame

Write"| |____________________________________|_____________|

_____|_____|_____|_____|_____|_____| |" to finame

End

Write"|

_____________________________________________________________________

_________________________________|" to finame

Close finame

Open finame in read mode

Read file from finame

Write file

Close finame

End StudentReport

Function ListSelect: Parameters lprint as pointer string,max as integer,instruction as string

Begin

code as integer

code=1

41 | P a g e
key as character

Repeat

Write" Scrolling Instructions "

Write" Please look on the keyboard for the keys below "

Write" W - Up,S - Down,Enter - Select "

Write" UP "

Write" _____ ___________ "

Write" | W | _____| | "

Write" _____|_____|_____ | | "

Write" | A | S | D | | Enter | SELECT "

Write" |_____|_____|_____| |_________________| "

Write" "

Write" DOWN "

Write instruction

Write" ______________________________________________ "

Write"|_Options______________________________________|"

Write"| |"

For n=1 n <= max n++

If code=n Then

Write"| (*) ",lprint[n]," |"

42 | P a g e
Else

Write"| ( ) ",lprint[n]," |"

End

End

Write"|______________________________________________|"

key= Get key from user

If key='w' OR key='W' Then

code=code-1

If code=0 Then

code=max

End If

Else If key='s' OR key='S' Then

code=code+1

If code=max+1 Then

code=1

End If

End If

Until key='\r'

Return code

Procedure Loop: Parameters lower as integer, upper as integer, print as string

43 | P a g e
Declare n as integer

For n=lower to upper do

Write print

End For

End Loop

44 | P a g e
Coding and Testing

45 | P a g e
C Code
/*

Designed by: Rushawn White 13-5

This program was designed to accomplish the following:

1. Allow the administrator to enter the information about students and classes

to set up the database for the program.

2. Allow teachers to use the system by entering their password.

3. Teachers may add and remove grades for students within their class.

4. Generate a student reports for students in the class.

*/

//Header Files

#include <stdio.h>

#include <string.h>

#include <windows.h>

//A structure called 'Subject' designed to store the grades of a subject

struct Subject{

int grade[20], gtot;

};

//A structure called 'Student' designed to store the name, sex, age and records of grades of

each subject

46 | P a g e
struct Student{

char name[50], sex;

int age;

struct Subject sub[10];

//Declare records to store information about students

}sprint[100], hmale, hfemale;

//A structure called 'Class' designed to store the class and teacher names,

//teacher password, ID number, total number of students and records of all students in the

class

struct Class{

char cname[10], tname[30], password[30];

int idnum, stot;

struct Student stud[100];

//Declare records to store information about classes

}cla[100], ctemp;

//Declare a global string array to store the list of subjects in the school

char *subject[100] =

{"","Mathematics","English_Language","Science","Social_Studies","Art","Physical_Educati

on","Drama","Music","Chess"};

47 | P a g e
//Declare a global string array to store the options a teacher can select within the program

char *option[100] = {"","View Grades","Add Grades","Remove Grades","Student

Report","Main Menu"};

//Declare Global Variables

int ctot, i, j, k, l, m, n, o, term;

char *plist[100], list[100][100];

FILE *ptr;

SYSTEMTIME rep, time;

//Declare Function Prototypes

void ScanSchool();

void UpdateSchool();

void AddGrades();

void StudentReport();

void Clear();

int ListSelect(char **, int, char []);

void ViewGrades();

void RemoveGrades();

void Loop(int, int, char []);

//Main Function

48 | P a g e
int main(){

int found = 0;

char pass[100];

//Fullscreen the console

ShowWindow(GetConsoleWindow(),SW_MAXIMIZE);

//Set the background to white and the font to red

system("color F4");

//Get the school information

ScanSchool();

//Accept the password from the teacher

printf("Enter your password to continue (ID Number+Last Name Ex: 10076Brown):

");

scanf(" %[^\n]s", pass);

//Search through the passwords of all teacher until the entered password matches one

for(i = 1; i <= ctot; i++){

//If the entered password matches a password of a teacher

if(strcmp(pass, cla[i].password) == 0){

//Set the finder variable to one, this means the password was correct

++found;

//Stop the loop to select the teacher's record

49 | P a g e
break;

//If the teacher's record was found

if(found == 1){

//Do the following until the teacher selects the 'Exit' option

do{

//Get the names of all the students so that the student list can be

generated

for(j = 1; j <= cla[i].stot; j++){

strcpy(list[j], cla[i].stud[j].name);

plist[j] = list[j];

//Set the last option to be 'Exit'

strcpy(list[j], "Exit");

plist[j] = list[j];

//Send the list of student names to be selected and get the code of the

option selected

j = ListSelect(plist, cla[i].stot+1, "Please select one of the students

below or exit:");

50 | P a g e
//If the teacher did not select the 'Exit' option

if(j != cla[i].stot+1){

//Do the following until the teacher selected the 'Main Menu'

option

do{

//Send the list of options to be selected and get the code

of the option

m = ListSelect(option, 5, "Please select one of the

options below:");

//Switch cases

switch(m){

//If the teacher selected the 'View Grades' option

case 1:

ViewGrades();

break;

//If the teacher selected the 'Add Grades' option

case 2:

AddGrades();

break;

//If the teacher selected the 'Remove Grades'

option

51 | P a g e
case 3:

RemoveGrades();

break;

//If the teacher selected the 'Student Report'

option

case 4:

StudentReport();

break;

Clear();

}while(m != 5);

}while(j != cla[i].stot+1);

puts("Thank you for using the St. Andrew Prep School program!");

//Update the school information

UpdateSchool();

}else{

puts("The passsword you entered is invalid!\nShutting down program...");

52 | P a g e
//A Procedure that gets the information about classes and students in the school

void ScanSchool(){

GetSystemTime(&rep);

//Get the current term based on the month

if(rep.wMonth >= 9 && rep.wMonth <= 12){

term = 1;

}else if(rep.wMonth >= 1 && rep.wMonth <= 4){

term = 2;

}else{

term = 3;

//If the database has not been created

if((ptr = fopen("School Database.txt", "r")) == NULL){

//Tell the admin the database is empty

puts("Welcome admin!\nThe database is empty!\nPlease fill out the form

below: ");

printf("Total classes: ");

scanf("%d", &ctot);

//Get the information about all classes in the school

for(i = 1; i <= ctot; i++){

53 | P a g e
printf("Name of the class (Ex. 6H): ");

scanf("%s", cla[i].cname);

printf("last name of the teacher (Ex. Brown OR James-Jackson): ");

scanf(" %[^\n]s", cla[i].tname);

printf("Total students in class: ");

scanf("%d", &cla[i].stot);

//Generate the ID of the teacher

cla[i].idnum = 10000 + i;

printf("Teacher ID: %d\n\n", cla[i].idnum);

//Generate the password for the teacher

itoa(cla[i].idnum, ctemp.password, 10);

strcat(ctemp.password, cla[i].tname);

strcpy(cla[i].password, ctemp.password);

//Get the information about all students in the class

for(j = 1; j <= cla[i].stot; j++){

printf("Form for student #%d:\nFirst and Last name (Ex. John

Brown): ", j);

scanf(" %[^\n]s", cla[i].stud[j].name);

printf("Age (Ex. 10): ");

scanf("%d", &cla[i].stud[j].age);

54 | P a g e
printf("Sex (M OR F): ");

scanf(" %c", &cla[i].stud[j].sex);

printf("%s added to class!\n\n", cla[i].stud[j].name);

//Tell the admin the class was successfully added

printf("Class %s was added to school database!\n", cla[i].cname);

Clear();

UpdateSchool();

//Display the list of all teachers and their respective classes, ID numbers and

passwords

puts(" __________________________________

____________________________________ ");

puts("|_Teacher______________|_Class_|_ID_Number_|

_Password__________________|");

puts("| | | | |");

for(i = 1; i <= ctot; i++){

printf("| %-20s | %-4s | %-5d | %-25s |\n", cla[i].tname,

cla[i].cname, cla[i].idnum, cla[i].password);

55 | P a g e
puts("|______________________|_______|___________|

___________________________|");

puts("Database Complete!");

Clear();

}else{

//Read the school information stored on the "School Database.txt" file

fscanf(ptr, "%d", &ctot);

for(i = 1; i <= ctot; i++){

fscanf(ptr, "%s %s %d %s %d", cla[i].cname, cla[i].tname,

&cla[i].idnum, cla[i].password, &cla[i].stot);

for(j = 1; j <= cla[i].stot; j++){

fscanf(ptr, " %[^\n]s", cla[i].stud[j].name);

fscanf(ptr, " %c %d", &cla[i].stud[j].sex, &cla[i].stud[j].age);

for(k = 1; k <= 9; k++){

fscanf(ptr, "%d", &cla[i].stud[j].sub[k].gtot);

for(l = 1; l <= cla[i].stud[j].sub[k].gtot; l++){

fscanf(ptr, "%d",

&cla[i].stud[j].sub[k].grade[l]);

56 | P a g e
}

fclose(ptr);

//A Procedure that pauses and clears the screen

void Clear(){

system("pause");

system("cls");

//A Procedure that updates the information about classes and students in the school

void UpdateSchool(){

//Open the "School Database.txt" file, clear it, and print the updated information to the

file

ptr = fopen("School Database.txt", "w");

fprintf(ptr, "%d\n", ctot);

for(i = 1; i <= ctot; i++){

fprintf(ptr, "%s %s %d %s %d\n", cla[i].cname, cla[i].tname, cla[i].idnum,

cla[i].password, cla[i].stot);

for(j = 1; j <= cla[i].stot; j++){

57 | P a g e
fprintf(ptr, "%s\n%c %d\n", cla[i].stud[j].name, cla[i].stud[j].sex,

cla[i].stud[j].age);

for(k = 1; k <= 9; k++){

fprintf(ptr, "%d\n", cla[i].stud[j].sub[k].gtot);

if(cla[i].stud[j].sub[k].gtot > 0){

for(l = 1; l <= cla[i].stud[j].sub[k].gtot; l++){

fprintf(ptr, "%d ", cla[i].stud[j].sub[k].grade[l]);

fprintf(ptr, "\n");

fclose(ptr);

//A Procedure that dislays the grades of a student organized by subject

void ViewGrades(){

int hightotgrade = 0;

//Find the highest total grade count for the subjects of a student

for(k = 1; k <= 9; k++){

58 | P a g e
if(cla[i].stud[j].sub[k].gtot > hightotgrade){

hightotgrade = cla[i].stud[j].sub[k].gtot;

//If the total grade count is greater than 0

if(hightotgrade > 0){

//Create a dynamic table showing the grades on the file organized by subject

printf("%s\n", cla[i].stud[j].name);

printf(" ____________________");

Loop(1, hightotgrade, "_______");

printf("\n| |");

Loop(1, hightotgrade, " |");

printf("\n| Subject Name |");

for(l = 1; l <= hightotgrade; l++){

printf(" Gr %d |", l);

printf("\n|____________________|");

Loop(1, hightotgrade, "______|");

printf("\n| |");

Loop(1, hightotgrade, " |");

59 | P a g e
printf("\n");

for(k = 1; k <= 9; k++){

printf("| %-18s |", subject[k]);

for(l = 1; l <= hightotgrade; l++){

printf(" %-3d |", cla[i].stud[j].sub[k].grade[l]);

printf("\n");

printf("|____________________|");

Loop(1, hightotgrade, "______|");

printf("\n");

}else{

printf("%s has no grades!\n", cla[i].stud[j].name);

//A Procedure that accepts new grades for a subject

void AddGrades(){

int gadd, gstart, gend;

//Get the subject the teacher is adding grades for

60 | P a g e
o = ListSelect(subject, 9, "Please select one of the subjects you are adding grades for

below:");

//Get the total number of grades being added

printf("Enter the amount of grades you are adding: ");

scanf("%d", &gadd);

//If the total number of grades being added is greater than 0

if(gadd > 0){

//Set the start and end for the for loop

gstart = cla[i].stud[j].sub[o].gtot+1;

gend = cla[i].stud[j].sub[o].gtot+gadd;

//Get the grades being added from the teacher

for(n = gstart; n <= gend; n++){

//Increase the total grades by 1

++cla[i].stud[j].sub[o].gtot;

//Get the grade from the user

printf("Grade #%d: ", n);

scanf("%d", &cla[i].stud[j].sub[o].grade[n]);

//Display the current list of grades after the teacher entered the grade

ViewGrades();

Clear();

61 | P a g e
}

puts("Grades added to database!");

}else{

puts("The total grades entered is invalid (less than 1).\nPlease try again!");

//A Procedure that removes a grade from a subject

void RemoveGrades(){

int gremove;

//Get the subject the teacher is removing a grade for

k = ListSelect(subject, 9, "Please select one of the subjects you are removing a grade

for below:");

//If the subject has at least 1 grade

if(cla[i].stud[j].sub[k].gtot > 0){

//Put the grades of the subject in list form

for(l = 1; l <= cla[i].stud[j].sub[k].gtot; l++){

itoa(cla[i].stud[j].sub[k].grade[l], list[l], 10);

plist[l] = list[l];

//Get the grade the teacher is removing for the subject

62 | P a g e
l = ListSelect(plist, cla[i].stud[j].sub[k].gtot, "Please select the grade you are

removing:");

//Remove the selected grade from the list of grades

for(n = l; n < cla[i].stud[j].sub[k].gtot; n++){

cla[i].stud[j].sub[k].grade[n] = cla[i].stud[j].sub[k].grade[n+1];

//Decrease the total grades of the subject by 1

--cla[i].stud[j].sub[k].gtot;

puts("Grade was removed!");

}else{

printf("%s has no grades!\n", subject[k]);

//A Procedure that generates a school report for a student

void StudentReport(){

char file[10000], finame[50];

int oaverage = 0, saverage[100];

//Calculate the average for each subject of the student as well as the overall average

for(k = 1; k <= 9; k++){

saverage[k] = 0;

63 | P a g e
if(cla[i].stud[j].sub[k].gtot > 0){

for(l = 1; l <= cla[i].stud[j].sub[k].gtot; l++){

saverage[k] += cla[i].stud[j].sub[k].grade[l];

saverage[k] /= cla[i].stud[j].sub[k].gtot;

oaverage += saverage[k];

oaverage /= 9;

//Generate the file name based on the student's name

strcpy(finame, cla[i].stud[j].name);

strcat(finame, ".txt");

ptr = fopen(finame, "w");

//Print the report for the student to the file

fprintf(ptr, "

_____________________________________________________________________

_________________________________\n");

fprintf(ptr, "| |\n");

fprintf(ptr, "| St. Andrew Preparatory School

|\n");

64 | P a g e
fprintf(ptr, "| School Report |\

n");

fprintf(ptr, "| |\n");

fprintf(ptr, "| Name of Child: %-40s ______________________________________

|\n", cla[i].stud[j].name);

fprintf(ptr, "| Class Teacher: %-20s |_____________RATINGS

USED_____________| |\n", cla[i].tname);

fprintf(ptr, "| Form: %-4s | | |\n",

cla[i].cname);

fprintf(ptr, "| Age: %-2d | E - Excellent S -

Satisfactory | |\n", cla[i].stud[j].age);

fprintf(ptr, "| No. of pupils in class: %-2d | V - Very Good N -

Needs Improvement | |\n", cla[i].stot);

fprintf(ptr, "| Final Grade: %-2d%% | G - Good U-

Unsatisfactory | |\n", oaverage);

fprintf(ptr, "| Term %d %-4d |

______________________________________| |\n", term, rep.wYear);

fprintf(ptr, "|

_____________________________________________________________________

_________________________________|\n");

65 | P a g e
fprintf(ptr, "|

_____________________________________________________________________

_________________ |\n");

fprintf(ptr, "| | | | | | | | | | |\n");

fprintf(ptr, "| | Subject Name | Average | E | V | G | S | N | U

| |\n");

fprintf(ptr, "| |____________________________________|_____________|

_____|_____|_____|_____|_____|_____| |\n");

fprintf(ptr, "| |____________________________________|_____________|

_____|_____|_____|_____|_____|_____| |\n");

for(k = 1; k <= 9; k++){

fprintf(ptr, "| | | | | | | | | | |\

n");

fprintf(ptr, "| | %-20s | %-3d |", subject[k], saverage[k]);

for(m = 1; m <= 6; m++){

if(m == 1 && saverage[k] >= 90){

fprintf(ptr, " * |");

}else if(m == 2 && saverage[k] >= 80 && saverage[k] < 90){

fprintf(ptr, " * |");

}else if(m == 3 && saverage[k] >= 70 && saverage[k] < 80){

fprintf(ptr, " * |");

66 | P a g e
}else if(m == 4 && saverage[k] >= 60 && saverage[k] < 70){

fprintf(ptr, " * |");

}else if(m == 5 && saverage[k] >= 50 && saverage[k] < 60){

fprintf(ptr, " * |");

}else if(m == 6 && saverage[k] < 50){

fprintf(ptr, " * |");

}else{

fprintf(ptr, " |");

fprintf(ptr, " |\n| |____________________________________|

_____________|_____|_____|_____|_____|_____|_____| |\n");

fprintf(ptr, "|

_____________________________________________________________________

_________________________________|\n");

fclose(ptr);

//Open the file and get the report that is stored on it, print it to the screen for the

teacher to view

ptr = fopen(finame, "r");

fscanf(ptr, " %[^\0]s", file);

67 | P a g e
fflush(ptr);

printf("%s", file);

fclose(ptr);

//A Function that displays a menu that allows the teacher to scroll through and select an

option of their choice

int ListSelect(char **lprint, int max, char instruction[]){

int code = 1;

char key;

system("cls");

//Do the following until the teacher selects an option

do{

//Display the instructions for scrolling through the options

puts(" Scrolling Instructions ");

puts(" Please look on the keyboard for the keys below ");

puts(" W - Up, S - Down, Enter - Select \n");

puts(" UP ");

puts(" _____ ___________ ");

puts(" | W | _____| | ");

68 | P a g e
puts(" _____|_____|_____ | | ");

puts(" | A | S | D | | Enter | SELECT ");

puts(" |_____|_____|_____| |_________________| ");

puts(" ");

puts(" DOWN \n");

//Print the purpose of the menu to the screen

printf("%s\n", instruction);

//Display a menu with the options that can be selected

puts(" ______________________________________________ ");

puts("|_Options______________________________________|");

puts("| |");

//Print all options

for(n = 1; n <= max; n++){

//If the option was selected then highlight the circle beside the option

if(code == n){

printf("| (*) %-40s |\n", lprint[n]);

}else{

printf("| ( ) %-40s |\n", lprint[n]);

69 | P a g e
puts("|______________________________________________|");

//Get the key entered from the teacher

key = getch();

//If the teacher pressed the 'W' key on the keyboard

if(key == 'w' || key == 'W'){

//select the option above the current selected option

--code;

//If the current selected option is the first option

if(code == 0){

//Set it to the last option

code = max;

//If the teacher pressed the 'S' key on the keyboard

}else if(key == 's' || key == 'S'){

//select the option below the current selected option

++code;

//If the current selected option is the last option

if(code == max+1){

//Set it to the first option

code = 1;

70 | P a g e
}

system("cls");

}while(key != '\r');

return code;

//A Procedure that prints a set of symbols a certain number of times

void Loop(int lower, int upper, char print[]){

int n;

//Print a set of symbols a set number of times

for(n = lower; n <= upper; n++){

printf("%s", print);

71 | P a g e
Test Plan

Variable Data Purpose Test Expecte Actual


Name Type of Data Data d Results
Results
Adding Classes to the Database
term Integer To store the 2 The user is Stores the
current term unaware that data
the school is this is
in occurring
ctot Integer To store the 1 Stores the Stores the
total number data and data and
of classes in prompts for prompts for
the school next input next input
cla[1].name String To store the 4B Stores the Stores the
name of the data and data and
1st class prompts for prompts for
next input next input
cla[1].tname String To store the Brown Stores the Stores the
last name of data and data and
the 1st prompts for prompts for
teacher next input next input
cla[1].stot Integer To store the 3 Stores the Stores the
number of data and data and
students in prompts for prompts for
the 1st class next input next input
cla[1].idnum Integer To store the 10001 The user is Stores the
ID number unaware that data
of the 1st this is
teacher occurring
cla[1].password String To store the 10001Brow The user is Stores the
password of n unaware that data
the 1st this is
teacher occurring
cla[1].stud[1].nam String To store the John Brown Stores the Stores the
e first and last data and data and
name of the prompts for prompts for
1st student next input next input
of the 1st
class
cla[1].stud[1].age Integer To store the 9 Stores the Stores the
age of the 1st data and data and
student of prompts for prompts for
the 1st class next input next input
cla[1].stud[1].sex Characte To store the M Stores the Stores the
r sex of the 1st data and data and

72 | P a g e
student of prompts for prompts for
the 1st class next input next input
cla[1].stud[2].nam String To store the Mary Jane Stores the Stores the
e first and last data and data and
name of the prompts for prompts for
2nd student next input next input
of the 1st
class
cla[1].stud[2].age Integer To store the 10 Stores the Stores the
age of the data and data and
2nd student prompts for prompts for
of the 1st next input next input
class
cla[1].stud[2].sex Characte To store the F Stores the Stores the
r sex of the data and data and
2nd student prompts for prompts for
of the 1st next input next input
class
cla[1].stud[3].nam String To store the Adam Stores the Stores the
e first and last Peterson data and data and
name of the prompts for prompts for
3rd student next input next input
of the 1st
class
cla[1].stud[3].age Integer To store the 10 Stores the Stores the
age of the data and data and
3rd student prompts for prompts for
of the 1st next input next input
class
cla[1].stud[3].sex Characte To store the M Stores the Stores the
r sex of the data and the data and the
3rd student admin is admin is
of the 1st informed informed
class that the class that the
was added class was
to the school added to the
database school
database
Password Authentication
Incorrect Data Below
pass String To gain 10010Brow The teacher The
access to the n was granted password
features of access to use entered is
the program the program invalid.
Program
terminates
Program runs again
Password Authentication
pass String To gain 10001Brow The teacher The teacher

73 | P a g e
access to the n was granted was granted
features of access to use access to
the program the program use the
program
Main Menu Selection
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
Incorrect Data Below
key Characte To store the r Selects the Nothing
r key entered next option changes
by the user
to select an
option
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 2 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and shows option and
option the menu for shows the
Mary Jane menu for
Mary Jane
j Integer To store the 2 The user is Stores the
index for unaware that data
the location this is
of the occurring
student
selected
Menu Selection for Mary Jane
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the order
to select an and prints a and Mary
option table Jane has no
showing all grades
grades for

74 | P a g e
Mary jane
m Integer To store the 1 The user is Stores the
index for unaware that data
the location this is
of the occurring
option
selected
Menu Selection for Mary Jane
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 2 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 3 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and shows option and
option the menu of shows the
subjects for menu of
Mary Jane subjects for
Mary Jane
m Integer To store the 3 The user is Stores the
index for unaware that data
the location this is
of the occurring
option
selected
Subject Menu Selection (Removing Grades)
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring

75 | P a g e
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and shows a option and
option menu of Mathematic
grades for s has no
Mathematics grades
o Integer To store the 1 The user is Stores the
index for unaware that data
the location this is
of the occurring
subject
selected
Menu Selection for Mary Jane
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 2 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and shows option and
option the menu of shows the
subjects for menu of
Mary Jane subjects for
Mary Jane
m Integer To store the 2 The user is Stores the
index for unaware that data
the location this is
of the occurring
option
selected
Subject Menu Selection (Adding Grades)
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the

76 | P a g e
to select an and asks for option and
option the number asks for the
of grades number of
being added grades being
for added for
Mathematics Mathematic
s
o Integer To store the 1 The user is Stores the
index for unaware that data
the location this is
of the occurring
subject
selected
Adding Grades for Mathematics
Incorrect Data Below
gadd Integer To store the -5 Stores the The total
total number data and grades
of grades asks for the entered is
being added grades for invalid (less
Mathematics than 1)
Menu Selection for Mary Jane
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 2 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and shows option and
option the menu of shows the
subjects for menu of
Mary Jane subjects for
Mary Jane
m Integer To store the 2 The user is Stores the
index for unaware that data
the location this is
of the occurring
option
selected
Subject Menu Selection (Adding Grades)

77 | P a g e
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and asks for option and
option the number asks for the
of grades number of
being added grades being
for added for
Mathematics Mathematic
s
o Integer To store the 1 The user is Stores the
index for unaware that data
the location this is
of the occurring
subject
selected
Adding Grades for Mathematics
gadd Integer To store the 5 Stores the Stores the
total number data and data and
of grades asks for the asks for the
being added grades for grades for
Mathematics Mathematic
s
gstart Integer To store the 1 The user is Stores the
position of unaware that data
the first this is
grade being occurring
added
gend Integer To store the 5 The user is Stores the
position of unaware that data
the last this is
grade being occurring
added
cla[1].stud[2]. Integer To store the 1 The user is Stores the
sub[1].gtot total grades unaware that data
for this is
Mathematic occurring
s
cla[1].stud[2]. Integer To store the 89 Store the Store the
sub[1].grade[1] 1st grade for data and data and
Mathematic asks for the asks for the
s for the 2nd next grade next grade
student for
the 1st class
cla[1].stud[2]. Integer To store the 2 The user is Stores the
sub[1].gtot total grades unaware that data
78 | P a g e
for this is
Mathematic occurring
s
cla[1].stud[2]. Integer To store the 93 Store the Store the
sub[1].grade[2] 2nd grade for data and data and
Mathematic asks for the asks for the
s for the 2nd next grade next grade
student for
the 1st class
cla[1].stud[2]. Integer To store the 3 The user is Stores the
sub[1].gtot total grades unaware that data
for this is
Mathematic occurring
s
cla[1].stud[2]. Integer To store the 84 Store the Store the
sub[1].grade[3] 3rd grade for data and data and
Mathematic asks for the asks for the
s for the 1st next grade next grade
student
cla[1].stud[2]. Integer To store the 4 The user is Stores the
sub[1].gtot total grades unaware that data
for this is
Mathematic occurring
s
cla[1].stud[2]. Integer To store the 88 Store the Store the
sub[1].grade[4] 4th grade for data and data and
Mathematic asks for the asks for the
s for the 2nd next grade next grade
student for
the 1st class
cla[1].stud[2]. Integer To store the 5 The user is Stores the
sub[1].gtot total grades unaware that data
for this is
Mathematic occurring
s
cla[1].stud[2]. Integer To store the 90 Grades were Grades were
sub[1].grade[5] 5th grade for added to the added to the
Mathematic database database
s for the 2nd
student for
the 1st class
Menu Selection for Mary Jane
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user

79 | P a g e
to select an
option
code Integer To store the 2 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 3 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and shows option and
option the menu of shows the
subjects for menu of
Mary Jane subjects for
Mary Jane
m Integer To store the 3 The user is Stores the
index for unaware that data
the location this is
of the occurring
option
selected
Subject Menu Selection (Removing Grades)
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and shows a option and
option menu of shows a
grades for menu of
Mathematics grades for
Mathematic
s
o Integer To store the 1 The user is Stores the
index for unaware that data
the location this is
of the occurring
subject
selected

80 | P a g e
Grades Menu Selection (Removing Grades)
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the W Selects the Selects the
r key entered previous previous
by the user option option
to select an
option
code Integer To store the 5 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the W Selects the Selects the
r key entered previous previous
by the user option option
to select an
option
code Integer To store the 4 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and the 4th option and
option (88) grade the 4th (88)
was grade was
removed removed
k Integer To store the 4 The user is Stores the
index for unaware that data
the location this is
of the grade occurring
selected
cla[1].stud[2]. Integer To store the 88 Store the Store the
sub[1].grade[4] 4th grade for data and data and
Mathematic asks for the asks for the
s for the 2nd next grade next grade
student
cla[1].stud[2]. Integer To store the 4 The user is Stores the
sub[1].gtot total grades unaware that data
for this is
Mathematic occurring
s
Menu Selection for Mary Jane
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is

81 | P a g e
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and prints a option and
option table prints a
showing all table
grades for showing all
Mary jane grades for
Mary jane
m Integer To store the 1 The user is Stores the
index for unaware that data
the location this is
of the occurring
option
selected
Menu Selection for Mary Jane
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 2 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 3 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the S Selects the Selects the
r key entered next option next option
by the user
to select an
option
code Integer To store the 4 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms

82 | P a g e
r key entered Key) the selection the selection
by the user of the option of the
to select an and shows a option and
option student shows a
report for student
Mary Jane report for
Mary Jane
m Integer To store the 4 The user is Stores the
index for unaware that data
the location this is
of the occurring
option
selected
Menu Selection for Mary Jane
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the W Selects the Selects the
r key entered previous previous
by the user option option
to select an
option
code Integer To store the 5 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection
by the user of the option of the
to select an and goes to option and
option main menu goes to
main menu
Main Menu Selection
code Integer To store the 1 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the W Selects the Selects the
r key entered previous previous
by the user option option
to select an
option
code Integer To store the 4 The user is Stores the
number for unaware that data
the option this is
selected occurring
key Characte To store the ‘\r’ (Enter Confirms Confirms
r key entered Key) the selection the selection

83 | P a g e
by the user of the option of the
to select an and closes option and
option the program closes the
program
Program Terminates

84 | P a g e
Test Results
Adding Classes to the Program

85 | P a g e
Password Authentication

Selecting a student (Mary Jane)

86 | P a g e
Attempt to look at the student’s grades (Error)

Attempt to remove grades (Error)

Attempt to add grades for Mathematics (Error)

87 | P a g e
Add grades for Mathematics

88 | P a g e
Removing a grade for Mathematics

Looking at the student’s grades

89 | P a g e
Generating a student report for a student

90 | P a g e
Going back to the student selection menu (Main Menu)

91 | P a g e
Exiting the program

92 | P a g e

You might also like