Documente Academic
Documente Profesional
Documente Cultură
150100000698
Documentation
DIT IT202 C Programming [Recording information]
Name: Wu Student ID: 150100000698 Class: IT202-C Programming Country: Brunei Darussalam Lecturer Name: Mr.
Wu IT202
Page 1
Wu
150100000698
Contents
1. Proposal
Page
1.1 Introduction ...................................................................................................................3 1.2 current system................................................................................................................4 1.3 Proposed new system....................................................................................................5 2. Program Specification 2.1 Screen Design .............................................................................................................6 2.2 Input Specification ......................................................................................................15 2.3 File Specification.........................................................................................................16 2.4 CRT Forms...................................................................................................................17 2.5 Processing & Validation..............................................................................................26 2.6 Program DesignFlowchart.......................................................................................28 3. Development (Program Listing).................................................................................33 4. Testing 4.1 Test Plan.......................................................................................................................54 4.2 Test Cases....................................................................................................................58 4.3 Test Log.......................................................................................................................96 5. Implementation 5.1 Hardware and software configuration..........................................................................98 5.2 User Manual.................................................................................................................99
Wu IT202
Page 2
Wu
150100000698
Wu IT202
Page 3
Wu
150100000698
1. Proposal 1.1INTRODUCTION
Oxford Business Language School is found in 1990 by Mr. Bu in Bandar Seri Begawan. The language school offers all kinds of language courses, such as English, French, Malay and Germany, Japanese, Chinese and so on. The courses are offer to every person who age above 10 years old. At presents, there are 2000 people in Oxford Business Language School. 1500 students are in English course, 500 students are in French course and 500 students are in Malay course. The school has totally hired 100 lecturers and staffs. Lecturers communicate with students through different languages. They always study and talk about learning skills to their students. The school also opens various activities for practicing different languages once a month. Those courses aim at promoting skills of speaking and listening. The school brings up students who will play important role in society. Mr. Bu hopes those students in learning language can speak frequently in society. Especially in the recent year, many tourists visit Brunei. Those tourists mostly come from Japan, China, Hong Kong, Europe, Australia and America. With the help of the Oxford Business Language School, many local people, who have finished their courses in the School, have gain the benefit to find many jobs in tourism industry.
Wu IT202
Page 4
Wu
150100000698
1.2CURRENT SYSTEM
Currently, there are many students study in Oxford Business Language School. The school has kept the information of every student in an old fashion paper system. One of the difficulties is to locate a record of a student. The current manual system has many disadvantages on below: 1. It takes time to find a record of a student, since the record is stored in a large filing cabinet. If the record has been misplaced, it will be hard to find. 2. It is lack of security of classified record. Such as, any person can view and edit all the confidential information of the students without permission. 3. Some words on the paper may be vague if those papers have been kept for a long time. 4. If someone changed his or her own information, such as hand phone number, etc, the staff of the school needs to give his or her paper to rewrite again for updating. 5. It spends a lot of money to buy papers and file folders. 6. It has to take a huge space for filing cabinet.
Wu IT202
Page 5
Wu
150100000698
There are some advantages of proposed new system: To find, edit and delete information easily To update new information without difficulty To improve security
Wu IT202
Page 6
Wu
150100000698
2. Program Specification
2.1 Screen Design Login.
|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| *| |*| WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL|*| |~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| *| ----------------------------------------------
Main Menu.
|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| |-|-| Oxford Business Language School |-|-| Main Menu ----------------------------1. Add student 2. Edit student 3. Search student 4. Delete student 5. Exit System ----------------------------Please enter your choice [1-5]:
Wu IT202
Add student.
Page 7
Wu
150100000698
|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| *| |*| WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL|*| |~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| *| --------------------------------------Profile: Student ID: Enter Full Name: Confirm Name: Enter Gender [F/M]: |~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| Enter Country: |*|Oxford Business Language School |*| Enter your Birthday: Enter Student Full Name to Edit: Enter HandPhone: - - - - - - Enter - - - - -Address: ---------------------------Student Profile: Course Name: Student ID: Join date: A. Full Name: Enter Guardian/Parents Name: B. Gender [F/M]: Confirm Name: C. Birthday: Enter Guardian/Parents Phone No: D. Address: Payments: E. Country: Do you want to save this record [Y/N]? F. HP No:
Edit student
Wu IT202
J. Guardian/Parents Name: K. Guardian/Parents Phone No: Choose letter which field you want to edit [AK]:
Page 8
Wu
150100000698
Search student.
SEARCH MENU -----------------------1. Search by Student Name 2. Search by Student ID 3. View All Records 4. Back to Main Menu Page 9
Wu IT202
Wu
150100000698
|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| |*|Oxford Business Language School |*| Enter Student Full Name to search: --------------------------------------Student Profile: Student ID: A. Full Name: B. Gender [F/M]: C. Birthday: D. Address:
Search by name.
Wu IT202
J. Guardian/Parents Name: K. Guardian/Parents Phone No: Do you want to view another record [Y/N]?
Page 10
Wu
150100000698
|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| |*|Oxford Business Language School |*| Enter Student ID to search: --------------------------------------Student Profile: Student ID: A. Full Name: B. Gender [F/M]: C. Birthday:
Search by student ID
Wu IT202
J. Guardian/Parents Name: K. Guardian/Parents Phone No: Do you want to view another record [Y/N]?
Page 11
Wu
150100000698
|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*| |*|Oxford Business Language School |*| |*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*| -------------------------------------Student ID: Full Name: Country: Birthday: Handphone No: Address: Course Name: Join Date: Guardian/Parents Name: Guardian/Parents Phone No: Payments: Gender:
Wu IT202
Address: Course Name: Join Date: Guardian/Parents Name: Guardian/Parents Phone No:
Page 12
Wu
150100000698
|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| |*|Oxford Business Language School |*| Enter Name to delete: --------------------------------------Student Profile: Student ID: A. Full Name:
Delete student
B. Gender [F/M]: C. Birthday: D. Address: E. Country: F. HP No: G. Join date: H. Course: I. Payments:
Wu IT202
J. Guardian/Parents Name: K. Guardian/Parents Phone No: Are you sure you want to delete it [Y/N]?
Page 13
Wu
150100000698
Wu IT202
Page 14
Wu
150100000698
Exit system
|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*| |*|Oxford Business Language School |*| |^|*|^|*|^|*|^|*|^|*|^|*|^|*|^|*|^| |-|Thank you for using this program! |-| Done by: Wu Jian Min Student ID: 150100000698
Wu IT202
Page 15
Wu
150100000698
2.2 Input Specification No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Name Password Choice ID Name Gender Country HP No Address Birth date Join date Course Payments Answer Answer Choice Name ID Name Name Description Password for login Main Menu Choice Student ID Full Name for student/Guardian/parents Student Gender Students country The HP No of Student/Guardian/Parents Student who lives address Students birth date Student who join the school Which course student choose Payments for course Save record or not Deleting record or not Search menu choice Name for editing ID for searching Name for searching Name for deleting Type int int int char char char int char char char char float char char int char int char char Size 3 20 1 20 20 20 20 20 10 10 1 1 1 20 3 20 20 Range 888 1-5 888 A-Z F/M A-Z 888 A-Z A-Z or 0-9 A-Z or 0-9 A-Z 888 Y/N Y/N 1-4 A-Z 888 A-Z A-Z
Wu IT202
Page 16
Wu
150100000698
2.3 File Specification No. 1 2. 3 4 5 6 7 8 9 10 11 Name Student ID Full Name Gender Country Birthday HandPhone Address Course Name Join Date Description ID for student Type int Size 3 20 1 20 20 7 20 20 20 20 7 Range 888 A-Z M/F A-Z A-Z and 0-9 888 A-Z A-Z A-Z or 0-9 A-Z 888
A Full Name char for student A student Gender Student country Student birth date Student contact No Student live place Taking subject name Join school date char char char int char char char char int
Guardian/Parents Guardian or Name parents name Guardian/Parents Guardian or HandPhone parents contact No Payments
12
10
888
Wu IT202
Page 17
Wu
150100000698
|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| *| |*| WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL|*| |~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| *| ---------------------------------------------Oxford Business Language School -------------------------------------|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~| Student Profile: |-|-| Oxford Business Language School Student ID: 999 |-|-| Enter Full Name: xxxxxxxxx Main Menu Confirm --- - - - - -Name: - - - - - xxxxxxxxx --------------Enter Gender [F/M]: x 1. Add student Enter Country: xxxxx 2. Edit student Enter your3. Birthday: 99-99-9999 Search student Enter HandPhone: 9999999 4. Delete student Enter Address: xxxxxx 5. Exit System Course - - - Name: - - - - - -xxxxxxx -------------------JoinPlease date: 99 xxxxxxxx 9999[1-5]: 9 enter your choice
Main Menu
Wu IT202
Add student
Payments: $999.99 Enter Guardian/Parents Name: xxxxxxxxx Confirm Name: xxxxxxxxx Enter Guardian/Parents Phone No: 9999999
Page 18
Wu
150100000698
Oxford Business Language School -------------------------------------Enter Name to Edit: xxxxxxxxx ---------------------------------- - - - - - Student Profile: Student ID: 999999999999 A. Full Name: xxxxxxxxx B. Gender [F/M]: x C. Birthday: 99-99-9999 D. Address: xx99xxxxxx E. Country: xxxxx F. HP No: 9999999
Edit student
Wu IT202
I. Payments: $999.99 J. Guardian/Parents Name: xxxxxxxxx K. Guardian/Parents Phone No: 9999999 Page 19
Wu
150100000698
Search student
Wu IT202
Page 20
Wu
150100000698
Oxford Business Language School -------------------------------------Enter Name to search: xxxxxxxxx ---------------------------------- - - - - - Student Profile: Student ID: 999999999999 Full Name: xxxxxxxxx Gender [F/M]: x Birthday: 99-99-9999 Address: xx99xxxxxx
Search by name
Wu IT202
Payments: $999.99 Guardian/Parents Name: xxxxxxxxx Guardian/Parents Phone No: 9999999 Do you want to view another record? [Y/N] x Page 21
Wu
150100000698
Oxford Business Language School -------------------------------------Enter student ID to search: 999999999999 ---------------------------------- - - - - - Student Profile: Student ID: 999999999999 Full Name: xxxxxxxxx Gender [F/M]: x Birthday: 99-99-9999
Search by student ID
Address: xx99xxxxxx Country: xxxxx HP No: 9999999 Join date: 99-99-9999 Course: xxxxxxxx
Wu IT202
Payments: $999.99 Guardian/Parents Name: xxxxxxxxx Guardian/Parents Phone No: 9999999 Do you want to view another record? [Y/N] x Page 22
Wu
150100000698
Oxford Business Language School --------------------------------------Student Profile: Student ID: 999999999999 Full Name: xxxxxxxxx Address: xx99xxxxxx HP No: Course: $999.99 9999999 xxxxxxx Gender [F/M]: x
- - - -all - -records --------------------------------view Student Profile: Student ID: 999999999999 Full Name: xxxxxxxxx Address: xx99xxxxxx HP No: 9999999 xxxxxxx Gender [F/M]: x
Wu IT202
Course: $999.99
Wu
150100000698
Oxford Business Language School -------------------------------------Enter Name to delete: xxxxxxxxx ---------------------------------- - - - - - Student Profile: Student ID: 999999999999 Full Name: xxxxxxxxx
Delete student
Gender [F/M]: x Birthday: 99-99-9999 Address: xx99xxxxxx Country: xxxxx HP No: 9999999 Join date: 99-99-9999 Course: xxxxxxxx
Wu IT202
Payments: $999.99 Guardian/Parents Name: xxxxxxxxx Guardian/Parents Phone No: 9999999 Do you want to delete this record? [Y/N] x Page 24
Wu
150100000698
Exit system
|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*| |*|Oxford Business Language School |*| |^|*|^|*|^|*|^|*|^|*|^|*|^|*|^|*|^| |-|Thank you for using this program! |-| Done by: Wu Jian Min Wu IT202 Student ID: 150100000698 Page 25
Wu
150100000698
2.5 Processing & Validation Login Password has to be entered in the login screen menu. A message prompts Access approved if user types correct password. Otherwise, an Invalid Password message will be appeared. The valid password is 12345 without double quotation. Main menu There are 5 options to choose from the main menu. Those options are Add student, Edit student, Search student, Delete student, and Exit System. The acceptable entry will be from 1-5. A message will prompt Invalid! Enter only from 1-5 if the entry is out of the range. Add student
Wu IT202 Page 26
Wu
150100000698
In the Add student display screen: 1. Only characters can be entered when typing a name. 2. Enter F or M only when enter a gender. 3. Do you want to save this record[Y/N]? will be pop-up when saving a record. Entering Y for yes and message Record has been saved. Entering N for no and go back to Main Menu. Edit student In the Edit student display screen: 1. User must type letters between A to L. If user enters invalid entry, a message Invalid Entry and choose data within A-L will come out, that is, user has entered a not stated letter. 2. Once a data complete to modify, user will be asked to modify the record or not. Answer Y, a message Record has been modified! will be prompted. Search student There are 4 options in this screen. Only 1 to 4 numbers are accepted to enter. So if user enters invalid choice number, a message Invalid and Enter only from 1 to 4! will be prompted. And if user types invalid information in the Search by ID or Name, a message Record Not Found! will be come out. Delete student A user will be asked whether the user really wants to delete this record or not in this screen. Answer Y, Record has been deleted! this message will be come out. Answer N that means cancel, either wise they will be asked to press any key to continue.
Wu IT202
Page 27
Wu
150100000698
Start
Display Welcome Screen
Enter password
No
Mai n Men u
Stop
Wu
150100000698
Start
Add student
Menu
Sav Start e?
Yes
Yes
Want to edit?
Yes
No
Mai n Men u
Wu IT202
Wu
150100000698
Wu IT202
options
Wu
150100000698
1 .Search by ID Enter ID
Data display
Mai n Men u
Data display
Yes
Mai n Men u
No
Mai n Men u
Yes
Wu IT202
Page 31
Wu
150100000698
Wu
150100000698
void addstudent(void);
void editstudent(void); //Edit student function void displayall(void); //Display student menu
void displayname(void); //Display student by searching name function void displayID(void); void viewall(void); void Delete(void); void Quit(void); //Display student by searching from course //Display student to view all function //Delete student function //Quit system function
void mainmenu(void); //Main Menu function void main (void) { int password, valid, try=1; printf("\n\n\n\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t|*|WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL |*|\n\n"); printf("\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); do{ printf("\n\t\t----------------------------\n\n"); printf("\t\tPlease Enter Password: "); scanf("%i", &password); if(password!=7890) { printf("\n\n\t\t\tInvalid password!\n"); valid=0; try+=1;
Wu IT202 Page 33
Wu
150100000698
} else valid=1; }while(!valid&&try<=3); //end of do_while if (try>3) printf("\n\n\n\t\tMaximun 3 try only! Closing system soon!\n"); else printf("\n\n\t\tAccess Approved!\n"); printf("\n\t\t------------------------------\n\n"); printf("\n\n\t\tPlease press any key to continue...\n"); getch(); if (password==7890) mainmenu(); } //Main Menu void mainmenu(void) { int Choice; system("cls"); //this for clear screen //main menu function
printf("\n\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\t|-|-| Oxford Business Language School |-|-|\n\n"); printf("\n\t\t\t Main Menu \n\n"); printf("\n\t\t---------------------------------\n\n"); printf("\n\t\t\t1. Add student\n\n");
Wu IT202 Page 34
Wu
150100000698
printf("\n\t\t\t2. Edit student\n\n"); printf("\n\t\t\t3. Search student\n\n"); printf("\n\t\t\t4. Delete student\n\n"); printf("\n\t\t\t5. Exit system\n\n"); printf("\n\t\t---------------------------------\n\n"); printf("\n\t\tPlease enter your choice[1-5]: "); scanf("%i", &Choice); switch(Choice) { case 1: addstudent(); //calling add student function break; case 2: editstudent(); //calling edit student function break; case 3: displayall(); //calling display student function/display menu break; case 4: Delete(); //calling delete student function break; case 5: Quit(); // calling quit system function break; default: printf("\n\tEnter only from 1 to 5 please!\n"); getch(); //pause system //calling the main menu function
mainmenu(); } }
Wu IT202
//end of switch
Page 35
Wu
150100000698
//Adding student void addstudent(void) { char FullName[20]; int idx=0, strSize, Valid; int ID=0; char Gender; char Address[20]; char country[20]; char course[20]; char Birthday[20]; int HandPhone; char JoinDate[20]; char GPName[20]; int GPHandPhone; float Payments; char answer; char answer1; FILE*studentfile; system("cls"); //clear screen do{ if((studentfile=fopen("c:\\c project\\students.dat", "a+"))==NULL) //opening file ID=1;
Wu IT202 Page 36
Wu
150100000698
else { do{ fscanf(studentfile, %03i %[^/]%*c %c %[^/]%*c %[^/]%*c %i %[^/]%*c % [^/]%*c %[^/]%*c %[^/]%*c %i %g%*c", &ID, FullName, &Gender,country, &Birthday, &HandPhone, &Address, &course, &JoinDate, &GPName, &GPHandPhone, &Payments ); }while(!feof(studentfile)); //end of do while ID+=1; } //end of else_if printf("\n\n\n\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t|*|WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL |*|\n\n"); printf("\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t----------------------------\n\n"); printf("\n\n\tProfile: \n\n"); printf("\n\t\tStudents ID: %03i", ID); printf("\n\n\t\tEnter FullName: "); fflush(stdin); gets(FullName); if(isalpha(FullName[idx])|| isspace(FullName[idx])) Valid=1; else Valid=0; ++idx; if(!Valid) {
Wu IT202 Page 37
Wu
150100000698
printf("\t\t\tName field contains invalid character!"); printf("\n\t\tEnter Right Name: "); fflush(stdin); gets(FullName); } else printf("\n\t\t\tConfirm Name: %s", FullName);
printf("\n\n\t\tEnter Gender: "); scanf("%c", &Gender); if(toupper(Gender)!='M' && toupper(Gender)!='F') { printf("\n\t\tInvalid Entry! Enter F or M only!\n\n\t\t Reenter Information of new student"); getch(); addstudent(); //calling add student function } else printf("\n\t\tEnter Country: "); fflush(stdin); gets(country);
Wu
150100000698
printf("\n\t\tEnter Guardian Name or Parents Name: "); fflush(stdin); gets(GPName); if(isalpha(GPName[idx])|| isspace(GPName[idx])) Valid=1; else Valid=0; ++idx; if(!Valid)
Wu IT202 Page 39
Wu
150100000698
{ printf("\t\t\tName field contains invalid character!"); printf("\n\t\tEnter Right Guardian Name or Parents Name: "); fflush(stdin); gets(GPName); } else printf("\n\t\t\tConfirm Name: %s", GPName);
printf("\n\t\t----------------------------\n\n"); printf("\n\t\tDo you want to save this record [Y/N]? \t"); fflush(stdin); scanf("%c", &answer); if(toupper(answer)=='Y') { printf("\n\t\tRecord has been saved!"); printf("\n\t\t----------------------------\n\n");
Wu IT202 Page 40
Wu
150100000698
fprintf(studentfile, "%03i %s/ %c %s/ %s/ %i %s/ %s/ %s/ %s/ %i %g\n", ID, FullName, Gender,country, Birthday, HandPhone, Address, course, JoinDate, GPName, GPHandPhone, Payments ); fclose(studentfile); //closing file } else { printf("\n\t\tRecord has not been saved!"); printf("\n\t\t----------------------------\n\n"); } printf("\n\t\tDo you want to save another record [Y/N]? \t"); fflush(stdin); scanf("%c", &answer1); system("cls"); //clear screen }while (answer1=='y'||answer1=='Y'); // end of do_while printf("\n\n\t\t Back to Main Menu by pressing any key!\n"); getch(); //pause system //calling main menu function
mainmenu(); }
//Edit module void editstudent(void) //edit function { FILE*studentfile, *temp1; char FullName[20], Target[20];
Wu IT202 Page 41
Wu
150100000698
int ID, Found=0; char Gender; char Address[20]; char country[20]; char course[20]; char Birthday[20]; int HandPhone; char JoinDate[20]; char GPName[20]; int GPHandPhone; float Payments; char answer; char choice1; system("cls"); //clear screen
Page 42
Wu
150100000698
printf("\n\n\tEnter Student Full Name to Edit: "); fflush(stdin); gets(Target); while(!feof(studentfile)) { fscanf(studentfile, %03i %[^/]%*c %c %[^/]%*c %[^/]%*c %i %[^/]%*c %[^/]%*c % [^/]%*c %[^/]%*c %i %g%*c", &ID, FullName, &Gender,country, &Birthday, &HandPhone, &Address, &course, &JoinDate, &GPName, &GPHandPhone, &Payments ); if(feof(studentfile)) break; if(strcmp(Target, FullName)!=0) { fprintf(temp1, "%i %s/ %c %s/ %s/ %i %s/ %s/ %s/ %s/ %i %g\n", ID, FullName, Gender,country, Birthday, HandPhone, Address, course, JoinDate, GPName, GPHandPhone, Payments ); } else { Found=1; printf("\n\t\t---------------------------------------\n\n"); printf("\n\t|-|Student Profile\n\n"); printf("\t\tStudent ID: printf("\t\tA. Full Name: if(toupper(Gender)=='F') printf("\t\tB. Gender:
Wu IT202
Female\n");
Page 43
Wu
150100000698
printf("\t\tC. Country: printf("\t\tD. Birthday: printf("\t\tE. HandPhone: printf("\t\tF. Address: printf("\t\tG. Course Name: printf("\t\tH. Join Date:
%s\n", country); %s\n", Birthday); %i\n", HandPhone); %s\n", Address); %s\n", course); %s\n", JoinDate); %s\n",GPName);
printf("\t\tJ. Guardian or Parents HandPhone#: %i\n", GPHandPhone); printf("\t\tK. Payments: $%g\n", Payments);
printf("\n\n\t\t---------------------------------------\n");
do{ printf("\n\t\tChoose letter which field you want to edit [A-K]: "); fflush(stdin); scanf("%c", &choice1); switch(choice1) { case 'A': printf("\n\n\t\tEnter New Full Name: "); fflush(stdin); gets(FullName);
Wu IT202 Page 44
Wu
150100000698
break; case 'B': printf("\n\t\tEnter New Gender: "); fflush(stdin); scanf("%c", &Gender); break; case 'C': printf("\n\t\tEnter New Country: "); fflush(stdin); gets(country); break; case 'D': printf("\n\t\tEnter New Birthday: "); fflush(stdin); gets(Birthday); break; case 'E': printf("\n\t\tEnter New HandPhone#: "); fflush(stdin); scanf("%i", &HandPhone); break; case 'F': printf("\n\t\tEnter Address: "); fflush(stdin);
Wu IT202 Page 45
Wu
150100000698
gets(Address); break; case 'G': printf("\n\t\tEnter Course Name: "); fflush(stdin); gets(course); break; case 'H': printf("\n\t\tEnter Join Date: "); fflush(stdin); gets(JoinDate); break; case 'I': printf("\n\t\tEnter Guardian or Parents Name: "); fflush(stdin); gets(GPName); break; case 'J': printf("\n\t\tEnter New Guardian or Parents HandPhone#: "); fflush(stdin); scanf("%i", &GPHandPhone); break; case 'K': printf("\n\t\tEnter New Payments: ");
Wu IT202 Page 46
Wu
150100000698
fflush(stdin); scanf("%g", &Payments); break; default: printf("\n\t\tInvalid Entry! Choose letter within A to K\n"); printf("\n\t\t---------------------------------------\n"); printf("=>Press any key back to main menu..."); getch(); mainmenu(); break; } // end of switch
}while((toupper(choice1)!='A')||(toupper(choice1)!='B')||(toupper(choice1)!='C')|| (toupper(choice1)!='D')||(toupper(choice1)!='E')||(toupper(choice1)!='F')||(toupper(choice1)!='G')|| (toupper(choice1)!='H')||(toupper(choice1)!='I')||(toupper(choice1)!='J')||(toupper(choice1)!='K')); //end of do_while do{ printf("\n\t\tDo you really want to modify [Y/N]? "); fflush(stdin); scanf("%c",&answer); switch(toupper(answer))
Wu IT202 Page 47
Wu
150100000698
{ case 'Y': printf("\n\n\t\tRecord has been modified!"); fprintf(temp1, "%03i %s/ %c %s/ %s/ %i %s/ %s/ %s/ %s/ %i %g\n", ID, FullName, Gender,country, Birthday, HandPhone, Address, course, JoinDate, GPName, GPHandPhone, Payments); break; case 'N': fclose(studentfile); fclose(temp1); remove("c:\\c project\\temp1.dat"); printf("\n\n\t\tNothing change the record!"); printf("\n\n\t\t Back to Main Menu by pressing any key!\n"); getch(); mainmenu(); break; default: printf("Invalid entry! Only enter 'Y' for Yes, 'N' for No!"); printf("\n\n\t\t Back to Main Menu by pressing any key!\n"); getch(); mainmenu(); break; } //end of switch
if((toupper(answer)=='Y')||(toupper(answer)=='N')) break;
Wu IT202 Page 48
Wu
150100000698
} } if (!Found) printf("\n\tNot Found the Record!"); } fclose(studentfile); fclose(temp1); //closing student file //closing temp1 file
remove("c:\\c project\\students.dat"); // delete student file rename("c:\\c project\\temp1.dat", "c:\\c project\\students.dat"); //rename temp1 as students file printf("\n\n\t\t Back to Main Menu by pressing any key!\n"); getch(); //pause system
//choice display module (search menu) void displayall(void) { // 1st bracket int Choice3;
Wu IT202 Page 49
//display menu
Wu
150100000698
system("cls");
//clear screen
printf("\n\n\n\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t|*|WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL |*|\n\n"); printf("\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t\tSEARCH MENU\n\n"); printf("\n\t\t--------------------------------------\n\n"); printf("\n\t\t1. Search by Student Name\n\n"); printf("\n\t\t2. Search by Student ID\n\n"); printf("\n\t\t3. View all records\n\n"); printf("\n\t\t4. Back to Main Menu\n\n"); printf("\n\t\t--------------------------------------\n\n"); printf("\n\n\tPlease enter your choice [1-4]: "); scanf("%i", &Choice3); switch(Choice3) { //opening switch bracket
case 1: displayname(); //calling display-search by name break; case 2: displayID(); break; case 3: viewall(); break;
Wu IT202 Page 50
Wu
150100000698
case 4: mainmenu(); break; default: printf("\n\t\t\t\tInvalid!\n\n\t\t\tEnter only from 1 to 4\n"); getch(); //pause system //calling mainmenu function
//display by name (search by name) void displayname(void) //search by name function { //1st bracket char FullName[20], Target[20]; int ID, Found=0; char Gender; char Address[20]; char country[20]; char course[20]; char Birthday[20]; int HandPhone; char JoinDate[20]; char GPName[20]; int GPHandPhone;
Wu IT202 Page 51
Wu
150100000698
float Payments; char answer; FILE*studentfile; system("cls"); //clear screen printf("\n\n\n\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t|*|WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL |*|\n\n"); printf("\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t-----------------------------------------------\n\n"); if((studentfile=fopen("c:\\c project\\students.dat", "r"))==NULL) //opening student file printf("\n\t\tFile Empty!"); else { //2nd bracket printf("\n\tEnter Student Full Name to search: "); fflush(stdin); gets(Target); while(!feof(studentfile)&&Found==0) { //begin of while bracket fscanf(studentfile, %03i %[^/]%*c %c %[^/]%*c %[^/]%*c %i %[^/]%*c %[^/]%*c %[^/]%*c %[^/]%*c %i %g%*c", &ID, FullName, &Gender,country, &Birthday, &HandPhone, &Address, &course, &JoinDate, &GPName, &GPHandPhone, &Payments ); if(strcmp(Target, FullName)==0) Found=1; } //end of while if(Found) { //3rd bracket
Wu IT202 Page 52
Wu
150100000698
printf("\n\t-------------------------------------\n"); printf("\n\t|-|Student Profile\n\n"); printf("\t\tStudent ID: printf("\t\tA. Full Name: if(toupper(Gender)=='F') printf("\t\tB. Gender: else printf("\t\tB. Gender: Male\n"); Female\n"); %03i\n ", ID); %s\n", FullName);
printf("\t\tC. Country: printf("\t\tD. Birthday: printf("\t\tE. HandPhone: printf("\t\tF. Address: printf("\t\tG. Course Name: printf("\t\tH. Join Date:
%s\n", country); %s\n", Birthday); %i\n", HandPhone); %s\n", Address); %s\n", course); %s\n", JoinDate); %s\n",GPName);
printf("\t\tJ. Guardian or Parents HandPhone#: %i\n", GPHandPhone); printf("\t\tK. Payments: $%g\n", Payments);
printf("\n\n\t\t---------------------------------------\n"); printf("Do you want to view another record [Y/N]?"); fflush(stdin); scanf("%c", &answer); while(toupper(answer)=='N') { //4th bracket
Wu IT202 Page 53
Wu
150100000698
printf("\n\n\tBack to Search Menu by pressing any key!\n"); getch(); //pause system displayall(); //calling display menu } //end of 4th bracket displayname(); //calling search by name function } //end of 3rd bracket if(!Found) printf("\n\t\t\t\tNot Found the Record!\n\n"); } //end of 2nd bracket fclose(studentfile); //closing student file
printf("\n\n\t=> Press any key to go back to search menu\n"); getch(); displayall(); } //pause system //calling display menu
char FullName[20]; int ID, Found=0; int Target; char Gender; char Address[20];
Wu IT202 Page 54
Wu
150100000698
char country[20]; char course[20]; char Birthday[20]; int HandPhone; char JoinDate[20]; char GPName[20]; int GPHandPhone; float Payments; char answer; FILE*studentfile; system("cls"); //clear screen
printf("\n\n\n\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t|*|WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL |*|\n\n"); printf("\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t-----------------------------------------------\n\n"); if((studentfile=fopen("c:\\c project\\students.dat", "r+"))==NULL) //opening file printf("\n\t\tFile Empty!"); else { //2nd bracket printf("\n\tEnter Student ID to search: "); fflush(stdin); scanf("%i", &Target); while(!feof(studentfile)&&Found==0) { //3rd bracket
Wu IT202 Page 55
Wu
150100000698
fscanf(studentfile, %03i %[^/]%*c %c %[^/]%*c %[^/]%*c %i %[^/]%*c %[^/]%*c %[^/] %*c %[^/]%*c %i %g%*c", &ID, FullName, &Gender,country, &Birthday, &HandPhone, &Address, &course, &JoinDate, &GPName, &GPHandPhone, &Payments ); if(Target==ID) Found=1; } //end of 3rd bracket if(Found) { //4th bracket printf("\n\t-------------------------------------\n"); printf("\n\t|-|Student Profile\n\n"); printf("\t\tStudent ID: printf("\t\tA. Full Name: if(toupper(Gender)=='F') printf("\t\tB. Gender: else printf("\t\tB. Gender: Male\n"); Female\n"); %03i\n ", ID); %s\n", FullName);
printf("\t\tC. Country: printf("\t\tD. Birthday: printf("\t\tE. HandPhone: printf("\t\tF. Address: printf("\t\tG. Course Name: printf("\t\tH. Join Date:
%s\n", country); %s\n", Birthday); %i\n", HandPhone); %s\n", Address); %s\n", course); %s\n", JoinDate); %s\n",GPName);
Wu
150100000698
printf("\t\tK. Payments:
$%g\n", Payments);
printf("\n\n\t\t---------------------------------------\n"); printf("\n\tDo you want to view another record [Y/N]? "); fflush(stdin); scanf("%c", &answer); while(toupper(answer)=='N') { //5th bracket
displayall(); //calling display menu } //end of 5th bracket displayID(); //calling search by studentID function } //end of 4th bracket
if (!Found) printf("\n\t\t\t\tNot Found the record!\n\n\t\t"); } //end of 2nd bracket fclose(studentfile); //closing student file
printf("\n\n\t=> Press any key to go back to search menu\n"); getch(); //pause system displayall(); //calling display menu }//end of 1st bracket
Wu
150100000698
char FullName[20]; int ID, Found=0; char Gender; char Address[20]; char country[20]; char course[20]; char Birthday[20]; int HandPhone; char JoinDate[20]; char GPName[20]; int GPHandPhone; float Payments; char answer; FILE*studentfile; system("cls"); //clear screen printf("\n\n\n\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t|*|WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL |*|\n\n"); printf("\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); if((studentfile=fopen("c:\\c project\\students.dat", "r+"))==NULL) //opening file printf("\n\t\tFile Empty!"); else { //2nd bracket
Wu IT202 Page 58
Wu
150100000698
while(!feof(studentfile)&&Found==0) { //3rd bracket fscanf(studentfile, %03i %[^/]%*c %c %[^/]%*c %[^/]%*c %i %[^/]%*c %[^/]%*c %[^/] %*c %[^/]%*c %i %g%*c", &ID, FullName, &Gender,country, &Birthday, &HandPhone, &Address, &course, &JoinDate, &GPName, &GPHandPhone, &Payments ); if(feof(studentfile)) break; printf("\n\t---------------------------------------\n"); printf(\n\tStudent ID: %03i\n\n\tFull Name: %s Gender: %c\n\n\tCountry: %s\n\n\tBirthday: %s\n\n\tHandPhone No: %i\n\n\tAddress: %s\n\n\tCourse Name: %s Join Date: %s\n\n\t Guardian or Parents Name: %s\n\n\tGuardian or Parents HP#: %i\n\n\tPayments: $%g, ID, FullName, Gender, country, Birthday, HandPhone, Address, course, JoinDate, GPName, GPHandPhone, Payments); } //end of 3rd bracket } //end of 2nd bracket
fclose(studentfile); //closing file printf("\n\t---------------------------------------\n"); printf("\n\n\t=> Press any key to go back to search menu\n"); getch(); //pause system displayall(); //calling display menu } //end of 1st bracket
Page 59
Wu
150100000698
char FullName[20], Target[20]; int ID, Found=0; char Gender; char Address[20]; char country[20]; char course[20]; char Birthday[20]; int HandPhone; char JoinDate[20]; char GPName[20]; int GPHandPhone; float Payments; char answer; FILE*studentfile, *temp; system("cls"); //clear screen temp=fopen("c:\\c project\\temp.dat","w"); //opening temp file if((studentfile=fopen("c:\\c project\\students.dat","r"))==NULL) //opening student file printf("\n\t\tFile Empty!"); else { //2nd bracket printf("\n\n\n\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t|*|WELCOME TO OXFORD BUSINESS LANGUAGE SCHOOL |*|\n\n"); printf("\t\t|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t---------------------------------------\n");
Wu IT202 Page 60
Wu
150100000698
printf("\n\tEnter Name to delete: "); fflush(stdin); gets(Target); while(!feof(studentfile)) { //3rd bracket fscanf(studentfile, %03i %[^/]%*c %c %[^/]%*c %[^/]%*c %i %[^/]%*c %[^/]%*c %[^/]%*c %[^/]%*c %i %g%*c", &ID, FullName, &Gender,country, &Birthday, &HandPhone, &Address, &course, &JoinDate, &GPName, &GPHandPhone, &Payments ); if(feof(studentfile)) break; if(strcmp(Target,FullName)!=0) fprintf(temp,"%03i %s/ %c %s/ %s/ %i %s/ %s/ %s/ %s/ %i %g\n",ID, FullName, Gender,country, Birthday, HandPhone, Address, course, JoinDate, GPName, GPHandPhone, Payments ); else { //4th bracket Found=1; printf("\n\t---------------------------------------\n"); printf("\n\t|-|Student Profile\n\n"); printf("\t\tStudent ID: printf("\t\tA. Full Name: if(toupper(Gender)=='F') printf("\t\tB. Gender: else printf("\t\tB. Gender:
Wu IT202
Female\n");
Male\n");
Page 61
Wu
150100000698
printf("\t\tC. Country: printf("\t\tD. Birthday: printf("\t\tE. HandPhone: printf("\t\tF. Address: printf("\t\tG. Course Name: printf("\t\tH. Join Date:
%s\n", country); %s\n", Birthday); %i\n", HandPhone); %s\n", Address); %s\n", course); %s\n", JoinDate); %s\n",GPName); %i\n", GPHandPhone); $%g\n", Payments);
printf("\t\tI. Guardian or Parents Name: printf("\t\tJ. Guardian or Parents HandPhone#: printf("\t\tK. Payments:
printf("\n\n\t\t---------------------------------------\n"); do{ printf("\n\tAre you sure you want to delete it [Y/N]? "); fflush(stdin); scanf("%s", &answer); switch(toupper(answer)) { case 'Y': printf("\n\t\t\tRecord has been deleted!\n"); break; case 'N': fclose(studentfile); fclose(temp); remove("c:\\c project\\temp.dat"); printf("\n\n\t=>Press any key to go back to main menu\n");
Wu IT202 Page 62
Wu
150100000698
getch(); mainmenu(); break; } //end of switch if((toupper(answer)=='Y')||(toupper(answer)=='N')) break; }while((toupper(answer)!='Y')||(toupper(answer)!='N')); //end of do_while } //end of 4th bracket } //end of 3rd bracket if(!Found) printf("\n\t\t\t\tRecord not found!\n"); } //end of 2nd bracket fclose(studentfile); fclose(temp); //closing student file //closing file
remove("c:\\c project\\students.dat"); rename("c:\\c project\\temp.dat","c:\\c project\\students.dat"); printf("\n\n\t=>Press any key to go back to main menu\n"); getch(); mainmenu(); } //pause system //calling main menu
Wu
150100000698
system("cls"); { printf("\n\n\n\t\t|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\t\t|*| OXFORD BUSINESS LANGUAGE SCHOOL |*|\n\n"); printf("\t\t|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|~|*|\n\n"); printf("\n\n\t\t|^|*|^|*|^|*|^|*|^|*|^|*|^|*|^|*|^|*|^|\n"); printf("\n\t\t|-|Thank you for using this program!|-|\n"); printf("\n\n\t\t\tDone by: Wu Jian Min\n\n"); printf("\t\t\tStudent ID: 150100000698"); printf("\n\n\t\t|^|*|^|*|^|*|^|*|^|*|^|*|^|*|^|*|^|*|^|\n"); system("pause"); } } //pause system
Wu IT202
Page 64
Wu
150100000698
4. Testing
I. Test Plan Test Case 1 Objectives When user enters correct password, a message Access Approved! will come out on the screen. When user enters incorrect Password, a message Invalid password! will come out on the screen. The maximum trying password is 3 times. And a message Maximum 3 tries only! Closing system soon! will show on the screen. And system will be terminated. In Main Menu, when user type number 1, Add student module will be shown. In Main Menu, when user type 2, Edit student module will be shown. In Main Menu, when user type 3, Search student module will be shown. In Main Menu, when user type 4, Delete student module will be shown. In Main Menu, when user type 5, Exit System module will be shown. In Main Menu, when user enters number that is out of 1-5. And then a message will be come out. In Add student module, when user enters Full Name is contain numbers. A message will be prompted and require user to enter right name. In Add student module, neither F nor M is entered in Gender, and then one message will
4 5 6 7 8 9
10
11
Wu IT202
Page 65
Wu
150100000698
be prompted. 12 In Add student module, when user enters Guardian Name is contain numbers. One message will be prompted and require user to enter right name. (Add student module) when user wants to save the record, user need to type Y or y. One message will be prompted. (Add student module) when user doesnt want to save the record, user need to type N or n. One message will be prompted. (Add student module) when user want to save other record, user need to type Y or y. And press Enter (Add student module) when user doesnt want to save other record, user need to type N or n. And press Enter (Edit student module) when user entered a wrong character (i.e. not within A-K), it should prompt them with a message (Edit student module) user need to choose a character within A-K which user want to modify (Edit student module) user should enter Y if user want to save the record that has been changed. (Edit student module) user should enter N if user doesnt want to save the changes made. (Edit student module) To verify that user will be prompt with a Record Not Found message when record is not found.
13
14
15
16
17
18
19
20 21
Wu IT202
Page 66
Wu
150100000698
22
(Search Menu module) user must enter choice within 1-4. A message will be prompted if choice out of 1-4. (Search Menu module) When nothing record stored in database, File empty will be prompted after user chooses from 1-4 to search. (Search Menu module) When user enters number 1, user can access search by name. (Search Menu module) When user enters number 2, user can access search by ID (Search Menu module) When user enters number 3, user can access view all record. (Search Menu module) When user enters number 4, user can access Back to Main Menu. (Search by name module) When user enters correct name which is stored in database, this record will be displayed. (Search by name module) When user enters name which is not stored in database, a message will be prompted. (Search by ID module) When user enters ID which is stored in database, this record will be displayed.
23
24 25 26 27
28
29
30
31
(Search by ID module) When user enters ID which is not stored in database, a message will be prompted. (Search by Name/ID module) To verify that when user enters Y, user will be able to search for another record when asked if they want to view another record.
32
Wu IT202
Page 67
Wu
150100000698
33
(Search by name/ID module) To verify that when user enters N, user will be not able to search for another record. (Delete student module) User needs to type name whose user wants to delete. If typing name is not stored in database, a message will be prompted. (Delete student module) User needs to type name whose user wants to delete. If typing name is stored in database, user need to confirm whether he really want to delete or not. (Delete student module) To verify that when user enters N, user will not delete this record. And user will be asked to back to main menu. (Delete student module) To verify that when user enters Y, user will delete this record. A message will be prompted.
34
35
36
37
Wu IT202
Page 68
Wu
150100000698
II. Test Cases Test Case Objectives 1 When user enters Correct Password, a message Access Approved! will come out on the screen. The correct password is 7890 The message Access Approved! is shown on the screen. Refer to screen capture. Actual result matched expected results.
Wu
150100000698
message Invalid password! will come out on the screen. Test Data Expected Result Actual Result: Test Conclusion Any wrong password. For example: 1234 The message Invalid password! is shown on the screen. Refer to screen capture. Actual result matched expected results.
3 The maximum trying password is 3 times. And a message Maximum 3 try only! Closing
Page 70
Wu
150100000698
system soon! will show on the screen. And system will be terminated. Test Data Expected Result Actual Result: Test Conclusion Any 3 wrong passwords. The message Maximum 3 try only! Closing system soon! is shown on the screen. Refer to screen capture. Actual result matched expected results.
4 In Main Menu, when user types 1, the program will access the Add student module. Typing number 1 and press Enter.
Page 71
Wu
150100000698
Add student module will show on the screen. Refer to screen capture. Actual result matched expected results.
5 In Main Menu, when user types 2, the program will access the Edit student module. Typing number 2 and press Enter.
Page 72
Wu
150100000698
Edit student module will show on the screen. Refer to screen capture. Actual result matched expected results.
6 In Main Menu, when user types 3, the program will access the Search student
Wu IT202
Page 73
Wu
150100000698
module. Test Data Expected Result Actual Result: Test Conclusion Typing number 3 and press Enter. Search menu module will show on the screen. Refer to screen capture. Actual result matched expected results.
7 In Main Menu, when user types 4, the program will access the Delete student
Wu IT202
Page 74
Wu
150100000698
module. Test Data Expected Result Actual Result: Test Conclusion Typing number 4 and press Enter. Delete student module will show on screen. Refer to screen capture. Actual result matched expected results.
8 In Main Menu, when user types 5, the program will access the Exit System module.
Wu IT202
Page 75
Wu
150100000698
Typing number 5 and press Enter. Exit system module will show on screen. Refer to screen capture. Actual result matched expected results.
9 In Main Menu, when user enters number that is out of 1-5. It will prompt a message. For example: type number 7
Page 76
Wu
150100000698
Enter only from 1 to 5 please! this message will be shown. Refer to screen capture. Actual result matched expected results.
10 In Add student module, when a user enters Full Name that contains any number . A message will be prompted and require the user to enter right name. For example: type name as 123phyllis
Test Data
Wu IT202
Page 77
Wu
150100000698
Name field contains invalid character! this message will be shown. Refer to screen capture. Actual result matched expected results.
11 In Add student module, neither F nor M is entered in Gender, then a message will be prompted. For example: type Gender as K Invalid Entry! Enter F or M only! this message will be shown. And a user needs to
Wu IT202
Page 78
Wu
150100000698
reenter the information of a new student. Actual Result: Test Conclusion Refer to screen capture. Actual result matched expected results.
12 In Add student module, when a user enters Guardian Name that contains any number . A message will be prompted and require the user to enter right name. For example: type name as 123Kim
Test Data
Wu IT202
Page 79
Wu
150100000698
Name field contains invalid character! this message will be shown. Refer to screen capture. Actual result matched expected results.
13 (Add student module) when a user wants to save the record, the user need to type Y or y. A message will be prompted. Type Y or y
Test Data
Wu IT202
Page 80
Wu
150100000698
Record has been saved! this message will be shown. Refer to screen capture. Actual result matched expected results.
14 (Add student module) when a user doesnt want to save the record, the user need to type N or n. A message will be prompted. Type N or n
Test Data
Wu IT202
Page 81
Wu
150100000698
Record has not been saved! this message will be shown. Refer to screen capture. Actual result matched expected results.
15 (Add student module) when a user wanst to save other record, the user needs to type Y or y. And press Enter Type Y or y
Test Data
Wu IT202
Page 82
Wu
150100000698
After pressing Enter, a new student profile will be come out on the screen. Refer to screen capture. Actual result matched expected results.
16 (Add student module) when a user doesnt want to save other record, the user need to type N or n. And press Enter Type N or n
Test Data
Wu IT202
Page 83
Wu
150100000698
After press Enter. User will be asked back to main menu by pressing any key. Refer to screen capture. Actual result matched expected results.
17 (Edit student module) when a user entered a wrong character (i.e. not within A-K), it should prompt the user with a message For example: type L
Test Data
Wu IT202
Page 84
Wu
150100000698
Expected Result
After pressing Enter, Invalid Entry! Choose letter within A to K message will be prompted. Refer to screen capture. Actual result matched expected results.
18 (Edit student module) user need to choose a character within A-K which user want to modify For example: type J After press Enter. User will be asked to type
Page 85
Wu
150100000698
new information. Actual Result: Test Conclusion Refer to screen capture. Actual result matched expected results.
19 (Edit student module) user should enter Y if user wants to save the changes made. Type Y After pressing Enter, Record has been
Page 86
Wu
150100000698
modified message will be prompted. Actual Result: Test Conclusion Refer to screen capture. Actual result matched expected results.
20 (Edit student module) user should enter N if user doesnt want to save the changes made. Type N
Test Data
Wu IT202
Page 87
Wu
150100000698
After pressing Enter, Nothing changes the record message will be prompted. Refer to screen capture. Actual result matched expected results.
21 (Edit student module) To verify that user will be prompt with a message when record is not found For example: Type Name as A
Test Data
Wu IT202
Page 88
Wu
150100000698
After pressing Enter, Not Found the Record message will be prompted. Refer to screen capture. Actual result matched expected results.
22 (Search Menu module) user must enter choice within 1-4. A message will be prompted if choice out of 1-4. For example: Type number 7 After pressing Enter, Invalid! Enter only
Page 89
Wu
150100000698
from 1 to 4 message will be prompted. Actual Result: Test Conclusion Refer to screen capture. Actual result matched expected results.
23 (Search Menu module) When nothing record stored in database, File empty will be prompted after user chooses from 1-4 to search. Choose number from 1 to 4. For example: 1
Test Data
Wu IT202
Page 90
Wu
150100000698
After press Enter, File empty message will be prompted. Refer to screen capture. Actual result matched expected results.
Test Case Objectives Test Data Expected Result Actual Result: Wu IT202
24 (Search Menu module) When user enters number 1, user can access search by name. Type number 1 After pressing Enter, Search by name screen is displayed. Refer to screen capture.
Page 91
Wu
150100000698
Test Conclusion
Test Case Objectives Test Data Expected Result Actual Result: Wu IT202
25 (Search Menu module) When user enters number 2, user can access search by ID. Type number 2 After pressing Enter, Search by student ID screen is displayed. Refer to screen capture. Page 92
Wu
150100000698
Test Conclusion
Test Case Objectives Test Data Expected Result Actual Result: Wu IT202
26 (Search Menu module) When user enters number 3, user can access view all record. Type number 3 After pressing Enter, View all record screen is displayed. Refer to screen capture. Page 93
Wu
150100000698
Test Conclusion
Wu IT202
Page 94
Wu
150100000698
27
Page 95
Wu
150100000698
Objectives
(Search Menu module) When user enters number 4, user can access Back to Main Menu. Type number 4 After pressing Enter, Main Menu screen is displayed. Refer to screen capture. Actual result matched expected results.
28 Page 96
Wu
150100000698
Objectives
(Search by name module) When user enters correct name which is stored in database, this record will be displayed. Type name as Phyllis After pressing Enter, Phylliss profile screen is displayed. Refer to screen capture. Actual result matched expected results.
29
Page 97
Wu
150100000698
Objectives
(Search by name module) When user enters name which is not stored in database, a message will be prompted. Type name as ABC After pressing Enter, Not found the Record message is prompted. Refer to screen capture. Actual result matched expected results.
Wu IT202
Page 98
Wu
150100000698
30 (Search by ID module) When user enters ID which is stored in database, this record will be displayed. Type student ID as 001 After pressing Enter, Phylliss profile screen is displayed. Refer to screen capture. Actual result matched expected results.
Wu IT202
Page 99
Wu
150100000698
31 (Search by ID module) When user enters ID which is not stored in database, a message will be prompted. Type student ID as 006 After pressing Enter, Not found the Record message is prompted. Refer to screen capture. Actual result matched expected results.
Test Case
32
Wu IT202
Page 100
Wu
150100000698
Objectives
(Search by name/ID module) To verify that when user enters Y, user will be able to search for another record when asked if user wants to view another record Type letter Y After pressing Enter, user will be asked again to enter which student they want to view. Refer to screen capture. Actual result matched expected results.
Test Case
33
Wu IT202
Page 101
Wu
150100000698
Objectives
(Search by name/ID module) To verify that when user enters N, user will be not able to search for another record. Type letter N After pressing Enter, user will be asked to back to search menu. Refer to screen capture. Actual result matched expected results.
Test Case
34
Wu IT202
Page 102
Wu
150100000698
Objectives
(Delete student module) User needs to type in the name which is wanted to delete. If typing name is not stored in database, a message will be prompted. Type Name as ABC After pressing Enter, Record not found will be prompted. Refer to screen capture. Actual result matched expected results.
Page 103
Wu
150100000698
the name which is wanted to delete. Test Data Expected Result Type Name as Ricky After pressing Enter, Are you sure you want to delete it [Y/N]? this question will be prompted. Refer to screen capture. Actual result matched expected results.
36 (Delete student module) To verify that when user enters N, user will not delete this record.
Wu IT202
Page 104
Wu
150100000698
And user will be asked to back to main menu. Test Data Expected Result Type letter N or n After pressing Enter, Are you sure you want to delete it [Y/N]? this question will be prompted. Refer to screen capture. Actual result matched expected results.
37 (Delete student module) To verify that when user enters Y user will delete this record. A
Wu IT202
Page 105
Wu
150100000698
message will be prompted. Test Data Expected Result Type letter Y or y After pressing Enter, Are you sure you want to delete it [Y/N]? this question will be prompted. And type letter Y. The message Record has been deleted! will be prompted. Refer to screen capture. Actual result matched expected results.
Successful Yes
Page 106
Wu
150100000698
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Wu IT202
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Page 107
Wu
150100000698
26 27 28 29 30 31 32 33 34 35 36 37
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
5. Implementation
5.1 Hardware and software configuration Hardware Configuration:
Wu IT202
Page 108
Wu
150100000698
1. VGA or higher resolution Monitor 2. Keyboard 3. Microsoft Mouse or compatible pointing device
Wu IT202
Page 109
Wu
150100000698
(Notice: Step2 and step3 are not necessary to do .User can directly move to step 4 below.) 2. Open folder c project to open file part2 by using Dev-C++
Wu IT202
Page 110
Wu
150100000698
3. Click Execute on the menu and select compile to compile it 4. Open Command Prompt which is cmd. * Type cd\ press Enter
5. Type part2 and press Enter and Enter password as 7890 and press Enter
Wu IT202
Page 111
Wu
150100000698
Wu IT202
Page 112
Wu
150100000698
7. Now here is Main Menu. There are 5 steps. User simply enters choice that user wants to run the program. Let us enter 1 to access add student module. And please enter all details step by step.
Wu IT202
Page 113
Wu
150100000698
9. To cancel saving other record, press N and press Enter. And press any key to go back to main menu.
Wu IT202
Page 114
Wu
150100000698
10. Let us enter 2 to access edit student module. Enter Name want to edit. After entering name, press Enter
Wu IT202
Page 115
Wu
150100000698
11. Enter letter you want to edit (A-K) and press Enter. For example: letter J
Wu IT202
Page 116
Wu
150100000698
13. Press any key to go back to main menu. 14. Let us enter 3 to access Search student module. And press Enter
Wu IT202
Page 117
Wu
150100000698
14.1. Enter 1 on the search menu to search record by student name. After tying name, the user presses Enter key.
Wu IT202
Page 118
Wu
150100000698
14.2. Enter 2 on the search menu to search record by student ID. After tying student ID, the user presses Enter key.
14.3. Enter 3 on the search menu to view all records and press Enter key.
Wu IT202
Page 119
Wu
150100000698
Wu IT202
Page 120
Wu
150100000698
Wu IT202
Page 121
Wu
150100000698
15. Let us enter 4 to access Delete student module. And press Enter
Wu
150100000698
Wu IT202
Page 123
Wu
150100000698
19. Let us enter 5 to access Exit system module. And press Enter
Wu IT202
Page 124
Wu
150100000698
5.3 Conclusion Strengths This program is very security. User needs to enter correct password before using the program. This program is very user friendly. It is easy to retrieve and save the profile of any student. This program comes with 3 optional searching functions, i.e., search by name, search by student ID or view the records of the all students. It also allows user to edit particular student records. User has to follow step by step instruction. If the user types wrong information, an error or a warning message will be appeared to show the user how to use. Weakness This program does not support back-up function. If the program was broken down, data would be disappeared. It does not allow user to categorize or sorting records. Enhancement To create another file to store the payments information of courses. To create another file to store the schedule of courses.
Wu IT202
Page 125
Wu
150100000698
6. Reference
1. IT202 C programming study guide 2. www.iu.hio.no/~mark/CTutorial/CTutorial.html 3. http://en.wikipedia.org/wiki/C_(programming_language) 4.http://www.google.com.sg/search? tbm=isch&hl=en&source=hp&biw=1366&bih=594&q=Oxford+Business+language+school&gbv =2&oq=Oxford+Business+language+school&aq=f&aqi=&aql=undefined&gs_sm=e&gs_upl=135 7l11606l0l39l35l8l14l22l0l437l1918l3-3.2l5 5. http://woodfile-cabinet.net/filing-cabinets/
Wu IT202
Page 126
Wu
150100000698
Wu IT202
Page 127
Wu
150100000698
CURRENT SYSTEM
Currently, there are many students study in Oxford Business Language School. The school has kept the information of every student in an old fashion paper system. One of the difficulties is to locate a record of a student. The current manual system has many disadvantages on below: 1. It takes time to find a record of a student, since the record is stored in a large filing cabinet. If the record has been misplaced, it will be hard to find. 2. It is lack of security of classified record. Such as, any person can view and edit all the confidential information of the students without permission. 3. Some words on the paper may be vague if those papers have been kept for a long time. 4. If someone changed his or her own information, such as hand phone number, etc, the staff of the school needs to give his or her paper to rewrite again for updating. 5. It spends a lot of money to buy papers and file folders. 6. It has to take a huge space for filing cabinet.
Wu IT202
Page 128
Wu
150100000698
There are some advantages of proposed new system: To find, edit and delete information easily To update new information without difficulty To improve security
Wu IT202
Page 129