• Save
C programming project by navin thapa
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

C programming project by navin thapa

on

  • 9,784 views

 

Statistics

Views

Total Views
9,784
Views on SlideShare
9,784
Embed Views
0

Actions

Likes
10
Downloads
0
Comments
1

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • This is a good C project document ......my project is different from your project (Library Management System)

    If you have no more problem, can you please give your document to me (mizan.se@outlook.com)

    thanks
    Abdullah Al Mizan
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

C programming project by navin thapa Document Transcript

  • 1. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 ‘C’ Programming Project ON Student Management SystemProject Title : STUDENT MANAGEMENT SYSTEMStudent Name : Navin ThapaStudent ID : 1801T3090164Country : NEPALCourse Code : CPG102Subject name :’C’ ProgrammingClass Code :IDITCCenter Code : 1801Lecturer : DEEPAK KUMAR KARNATABLE OF CONTENTS:Name : Navin Thapa Page 1
  • 2. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 S.NO. TITLE PAGE NO. 1 Introduction 3 2 Current System 4 3 Proposed System and Objectives 5 4 Program Specification 6 4.1 Input Specification 6 4.2 File Specification 7 4.3 Screen Design 8-18 4.4 Processing and Validation 19-20 5 Program design and Pseudocode 21-27 6 Program Listing 28-63 7 Program Testing 64 7.1 Test Plan 64-65 7.2 Test and Results 65-73 8 Implementation 74 9 User Manual 75-83 10 Conclusion 84 10.1 Program Weakness 84 10.2 Program Strengths 84 10.3 Program Enhancement 84 11 Acknowledgement 85 12 References 86 13 Turnitin Report 87 1)Introduction: In today’s world, the way of functioning and managing the system has been totallychanged. There is a sudden and abrupt changes in the structure, maintenance andmodification, handling, leveling inside every system. Without managing system throughcomputer applications and programming, the development of infrastructures are unfinished.Name : Navin Thapa Page 2
  • 3. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164There are many errors and drawbacks without use of computer programming andapplications. As we know that, “necessity is the mother of invention”, so in today’s challenging world,every system is developed and launched by the use of computer software and programming.As student and schools are two related terms of the education field, there should be properway of management. The title of the project is related to the student i.e. “StudentManagement System” . Student Management System deals with basic record of student likename, class, section, roll no, address, phone no, contact ID etc, adding new student’s recordremoving students file who have already left the school and modifying those existed records. Due to the excessive growing of no. of schools in the country, it is very tough to handleimportant files and data of each student correctly, efficiently and systematically. Location ofthose data may be inaccurate and difficult to access when they are required. So, by the use ofstudent management system, users can easily maintain files and record in a systematic way.Only authorized users are allowed to enter through the system. So, security is also maintain inthe system. The other feature of this management system is file storing safely, easy accesswhen needed, data addition, deletion and modification. Thus, student management system, being one of the major necessity in today’s educationfield. So, it can solve almost all the problems and can reached to the each and everyrequirements of the user.Name : Navin Thapa Page 3
  • 4. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 2)Current System : Same old record keeping system is existed till now in most of the school areas. No anydevelopment has been made through the use of computer system. All the records aremanaged using huge paper made registers, note-copies and hard-covers. So, its not a kind ofdata management, we can say. Its totally unsafe as well as uncivilized way of filing andindexing system. Only the advanced and private colleges or schools of urban areas usescomputer applications for the handle of records existing on them. But there is no effort hasbeen made in the government schools in order to establish new computerized and digital wayof file keeping system. Due to these reasons, the education system in the country is undeveloped. Manyunwanted environmental factors like fire, heavy rain etc damages the handwritten filestotally. Not only natural disasters but also the theft and robbery are also equally affecting lostof data, important records and files. So, it’s a totally mess. So, in the present context, no any well-satisfied and secure system has been made so thatthey can meet all the user’s requirements. There are many schools and student managementsystems developed, but they are too costly, advanced and difficult to use by the normal usersbecause of very sophisticated technologies used. So, there is no any software made which are100% fit for the school to manage the student’s basic information and certain medium levelof security in the context of Nepal.Name : Navin Thapa Page 4
  • 5. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 3)Proposed System and Objectives: “Student Management System”, is a simple application, which is especially generatedand designed for the school levels in order to enter the student’s basic record and informationand can perform other functions like addition, deletion and modification if required. It isusername and password protected as well. So, a school need a normal computer applicationlike this where it has ability to do all those task like other programs do. Followings are the major objectives behind the new proposed system:-It creates user friendly environment, where a normal user can easily access through all thebenefits of the system.-It provides security from unauthorized access, only admin or authorized users are access-granted to the system.-It increases efficiency and saves the time.-No any danger and obstacles from external entities.-Easy access of saved data inside the system.Name : Navin Thapa Page 5
  • 6. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 4)Program Specification: 4.1) Input Specification: struct information S. no Variable Name Description Data Type Size 1) id Student id Int 4 2) name Student’s name Char 30 3) cls For the student’s Char 10 class or grade 4) section To identify which Char 10 section of a class 5) address For the address of Char 50 the student 6) email Email address of Char 20 the student 7) rollno Student’s roll no. Char 10 8) phoneno Student’s contact char 10 no.Name : Navin Thapa Page 6
  • 7. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 4.2) File Specification: Name Description Datatype *fpt File pointer for viewing student’s record. File pointer *fpt File pointer for adding new record of student. File pointer *fpt File pointer for deleting record of student. File pointer *fpt File pointer for modifying record of student. File pointer *fpt File pointer for searching record of student. File pointer *fpt File pointer for listing record of student. File pointer *fpt File pointer to generate id of a student. File pointer *ph File pointer to check the length and validity of File pointer phone numberName : Navin Thapa Page 7
  • 8. Project: ’C’ Programming (CPG 102)Student ID: 1801T30901644.3) Screen Design:Output screen design:Name : Navin Thapa Page 8
  • 9. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Welcome screen:Name : Navin Thapa Page 9
  • 10. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Login screen:Name : Navin Thapa Page 10
  • 11. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Unaccess screen:Name : Navin Thapa Page 11
  • 12. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Menu screen:Name : Navin Thapa Page 12
  • 13. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Enter new:Name : Navin Thapa Page 13
  • 14. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Display screen:Name : Navin Thapa Page 14
  • 15. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Modify screen:Name : Navin Thapa Page 15
  • 16. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Delete screen:Name : Navin Thapa Page 16
  • 17. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Search and view screen:Name : Navin Thapa Page 17
  • 18. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Exit screen:Name : Navin Thapa Page 18
  • 19. Project: ’C’ Programming (CPG 102)Student ID: 1801T30901644.4) Processing and Validation :1) Login Username and Password: Correct username and password enables user to access through the main system.Otherwise, there are remaining attempts to try again. If not, user will be unauthorized and getout of the system.2) Main menu: There are number of options regarding users to add new records, display existing records,deletion of records, modifications, searching and viewing records or can exit from the system.There are 1-6 options that the user can choose, if any foreign inputs are entered, then errormessage is displayed regarding invalid inputs.3) Entering new record: All the fields should be fulfilled with correct identifications. Roll no. , phone no. , classare digit characters. Name, section, address, email, should be characters.4)Displaying records: It displays all the existing records of the student .Press any key to give continuity toview records.5)Deletion of records: To delete the record, type in correct full-name of the desire student. Then, just press anykey to delete further successfully. IF not entered correct name, record will not be displayed.6)Modification: To modify the students record, type correct full name of the student which has to bemodified. Then, modify the field of the record of that student.7)Searching: Correct name should be entered in-order to view the desire student’s record. If notentered correct name, then it can’t be accessed.Name : Navin Thapa Page 19
  • 20. Project: ’C’ Programming (CPG 102)Student ID: 1801T30901648)Uniqueness: Each name and id should be unique throughout all the existing records. Name should be ofcharacter type and id should be of digit. Character and digits are not allowed.9)Checking of size:Id cannot be greater than 4 of size.Name can’t be greater than 30 characters.Address can’t be greater than 50 characters.Email can’t be greater than 20 characters.Phone no. can’t be greater than 20 digits.Name : Navin Thapa Page 20
  • 21. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 5)Program design and Pseudocode : Main page: DO CALL mainpage ENDDO Login System: REPEAT UNTIL n==0 DO CALL login screen CALL INPUT Enter Username CALL INPUT Enter password IF (check) DO CALL displayMenu ENDDO ENDIF ELSE DO DISPLAY Wrong username or passwords try again n-- ENDOName : Navin Thapa Page 21
  • 22. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Main menu:CALL menu CALL draw DO choice equal (1-6) GET choice DOCASE choice 1 DO CALL Enter new record ENDDO choice 2 DO CALL Display record ENDDO choice 3 DO CALL Modify record ENDDO choice 4 DO CALL Delete record ENDDO choice 4 DO CALL Search and view record ENDDOName : Navin Thapa Page 22
  • 23. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 choice 4 DO Exit ENDDO OTHERWISE DO DISPLAY “Invalid Input” ENDDO ENDCASE ENDDOModule Enter new record: DO CALL draw CALL generate ID CALL input string for Student’s name CALL input value for Student’s class CALL input value for Student’s section CALL input value for Student’s address CALL input value for Student’s email CALL input value for Student’s rollno CALL input value for Student’s phoneno OPEN ADDRESSB.dat file in append mode CALL write ADDRESSB.dat file IF write is successful THENName : Navin Thapa Page 23
  • 24. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 DO DISPLAY "Record Added Successfully!" ENDDO DISPLAY "Do you want to add more?(Y/N)" Get character for another ENDDO CLOSE file CALL menu ENDDOModule Display record:DO Open ADDRESSB.dat file in read mode Call Draw WHILE read ADDRESSB.dat file DO Display information Display details ENDDO DISPLAY "Press any key to continue” Get characterCALL menuENDDOName : Navin Thapa Page 24
  • 25. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Module modify record:DO CALL draw CALL input Name OPEN ADDRESSB.dat file in append binary plus mode IF Name equals name THEN DO CALL modify ENDDO ENDIF DISPLAY record not found CLOSE ADDRESSB.dat file CALL ask message IF reply equals ‘Y’ THEN DO CALL modify ENDDO ENDIF CALL menu ENDDOName : Navin Thapa Page 25
  • 26. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Module Delete record:DO CALL draw CALL input employee name OPEN ADDRESSB.dat file in append binary mode IF name equals name THEN DO CALL delete ENDDO ENDIF DISPLAY record not found CALL ask message IF reply equals ‘Y’ THEN DO CALL delete END ENDIF CALL menu ENDDOName : Navin Thapa Page 26
  • 27. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Module Search record:DO CALL draw CALL input name OPEN ADDRESSB.dat file in append binary plus mode IF name equals name THEN DO CALL display ENDDO ENDIF DISPLAY Record not found CALL ask message IF reply equal ‘Y’ THEN DO CALL search ENDDO ENDIF CALL menu ENDDOName : Navin Thapa Page 27
  • 28. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 6)Program Listing :#include<stdio.h>#include<conio.h>#include<graphics.h>#include<stdlib.h>#include<ctype.h>#include<dos.h>#include<process.h>/*defining required macros*/#define PH 10 //phone number length/*validating required functions*/void checkString(char *);void check_phone(char *,int); //Checks for the length and validity of phone numberint checkDigit(char *);int checkChar(char *);int generateID();void add();void view();Name : Navin Thapa Page 28
  • 29. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164void search();void list(); //display the recordvoid del(); // to delete the recordvoid modify();void rec(); //scan the new recordvoid mainpage(); //starting pagevoid load(void); //shows loading..int logscreen();void callExit();void menu();void border();void date();void drawoutbox(int,int,int,int,int);/*MISC FUNCTION*/void empty();/*declaring structure*/struct information{ int id; //student id char name[30]; //name of student char cls[10]; //class of studentName : Navin Thapa Page 29
  • 30. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 char section[10]; //section of a class of student char address[50]; // Address char email[20]; // email address char rollno[10]; //roll no. of a student char phoneno[10]; // contact number};struct information c;FILE* fpt;void main(){ clrscr(); mainpage(); logscreen(); getch();}void date(){ struct date dt; getdate(&dt);Name : Navin Thapa Page 30
  • 31. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 gotoxy(58,5); printf(" DATE:- %d.%d.%d ",dt.da_day,dt.da_mon,dt.da_year);}void mainpage(){ int process=0; _setcursortype(_NOCURSOR); clrscr(); date(); drawoutbox(18,7,64,12,RED); textcolor(GREEN); gotoxy(27,10); printf("STUDENT MANAGEMENT SYSTEMn"); gotoxy(25,16); printf("Prepared By"); gotoxy(40,16); printf(":"); gotoxy(42,16); printf("BIBESH PRAJAPATI"); gotoxy(25,18); printf("ID. NO."); gotoxy(40,18); printf(":"); gotoxy(42,18); printf("1801T3090164"); gotoxy(25,20); printf("Subject"); gotoxy(40,20); printf(":"); gotoxy(42,20); printf("CProgramming"); gotoxy(25,22); printf("MODULE Code");Name : Navin Thapa Page 31
  • 32. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 gotoxy(40,22); printf(":"); gotoxy(42,22); printf("CPG102"); gotoxy(25,24); printf("Lecturer Name"); gotoxy(40,24); printf(":"); gotoxy(42,24); printf("Deepak Kumar Karna"); gotoxy(25,26); printf("Center Code"); gotoxy(40,26); printf(":"); gotoxy(42,26); printf("1801"); gotoxy(25,28); printf("Course"); gotoxy(40,28); printf(":"); gotoxy(42,28); printf("IDITC"); gotoxy(25,30); printf("Country"); gotoxy(40,30); printf(":"); gotoxy(42,30); printf("Nepal"); gotoxy(27,35); printf("Press any Key to continue....."); getch(); gotoxy(27,38); printf("LOADING"); gotoxy(34,38); for(process=0;process<25;process++) { delay(150); printf("%c",223); }Name : Navin Thapa Page 32
  • 33. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164}int logscreen(){ char username[30]; char password[30]; int try =0; int true = 1; do { clrscr(); gotoxy(30,20); cprintf("Username: "); gotoxy(30,22); cprintf("Password: "); gotoxy(42,20); scanf("%s",username); gotoxy(42,22); scanf("%s",password); if(stricmp(username,"admin")==0 && strcmp(password,"pass")==0) { gotoxy(30,30); printf("You are accessed to the system!!");Name : Navin Thapa Page 33
  • 34. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 getch(); menu(); clrscr(); getch(); true =0; } else { clrscr(); try = try+1; gotoxy(25,25); cprintf("No. of attempts remain:%d",3-try); getch(); if(try>=3) { gotoxy(15,30); printf("Please type in correct username and password"); gotoxy(10,33); cprintf("No permission to enter the system!!" ); getch(); callExit(); getch();Name : Navin Thapa Page 34
  • 35. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 ; } } //END OF ELSE }while(true==1); }void menu(){ int input; clrscr(); border(); gotoxy(26,10); printf("STUDENT MANAGEMENT SYSTEM"); drawoutbox(20,15,60,36,GREEN); gotoxy(30,19); printf(" 1. Enter new Records"); gotoxy(30,21); printf(" 2. Display Records"); gotoxy(30,23); printf(" 3. Modify Records"); gotoxy(30,25); printf(" 4. Delete Records"); gotoxy(30,27); printf(" 5. Search and view Records"); gotoxy(30,29);Name : Navin Thapa Page 35
  • 36. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 printf(" 6. Exit"); gotoxy(22,34); printf("Choose options:[1/2/3/4/5/6]:"); gotoxy(53,34); fflush(stdin); input=getch(); switch(input) { case 1: { clrscr(); add(); //call add() function }break; case 2: { clrscr(); view(); }break; case 3: { clrscr(); modify(); getch(); }break;Name : Navin Thapa Page 36
  • 37. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 case 4: { clrscr(); del(); }break; case 5: { clrscr(); search(); }break; case 6: { clrscr(); border(); gotoxy(30,25); printf("Thank you !!"); getch(); exit(0); }break; default: { border(); gotoxy(30,25);printf("Invalid input!!"); gotoxy(28,30);printf("Press any key to choose again"); getch(); menu(); } }Name : Navin Thapa Page 37
  • 38. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164}void add(){ char input; clrscr(); border(); printf(" "); c.id=generateId(); gotoxy(26,10);printf("Enter The Information Below: "); gotoxy(22,15); printf("id. %d",c.id); gotoxy(22,17);printf("Full name :"); gotoxy(22,19);printf("Class :"); gotoxy(22,21);printf("Section :"); gotoxy(22,23);printf("Address :"); gotoxy(22,25);printf("Email Address :"); gotoxy(22,27);printf("Roll No. :"); gotoxy(22,29);printf("Phone No. :"); fflush(stdin); //do //{Name : Navin Thapa Page 38
  • 39. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 gotoxy(39,17); checkString(c.name); fflush(stdin); //}while(checkChar(c.name)!=1); //do //{ gotoxy(39,19); checkString(c.cls); fflush(stdin); //}while(checkChar(c.cls)!=1); gotoxy(39,21); checkString(c.section); fflush(stdin);gotoxy(39,23); checkString(c.address); fflush(stdin); gotoxy(39,25); checkString(c.email); //email address fflush(stdin);Name : Navin Thapa Page 39
  • 40. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 gotoxy(39,27); checkString(c.rollno); fflush(stdin);gotoxy(39,29); check_phone(c.phoneno, PH); fflush(stdin); //list();getch(); fpt=fopen("addressb.dat","ab+"); printf("n %d",c.id); fwrite(&c,sizeof(c),1,fpt); fclose(fpt); gotoxy(24,10); printf("Record added successfully!!"); gotoxy(20,40);printf("Do you want to add more?(Y/N)"); input=getche(); if(input==Y || input==y) { add(); } else menu(); getch();Name : Navin Thapa Page 40
  • 41. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164}void view(){ int flag=0; fpt=fopen("addressb.dat","rb"); if(fpt!=NULL) { clrscr(); while( fread(&c, sizeof(c), 1, fpt)!=0) { if(strcmp(c.id," ")!=0) { flag=1; clrscr(); border(); gotoxy(28,8); printf("<<-DISPLAYING EXISTING RECORDS->>"); list(); //display the record gotoxy(26,38); printf("Press any key to continue..");Name : Navin Thapa Page 41
  • 42. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 fflush(stdin); getch();getch(); } //menu(); /*if(strcmp(c.id," ")==NULL) { } */ } fclose(fpt); menu(); } else { border(); gotoxy(25,24); printf("Sorry,Unable to find the records!"); menu(); } if(flag!=1) { clrscr();Name : Navin Thapa Page 42
  • 43. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 border(); gotoxy(20,13); sound(500);delay(200);nosound(); printf("<<==No record has been entered==>>"); getch(); gotoxy(30,26);printf("Press any key to enter the menu"); menu(); }}void search(){ int ch; char cno[20]; clrscr(); border(); fpt=fopen("addressb.dat","rb"); gotoxy(20,13); printf("ENTER STUDENTS FULL NAME:"); checkString(cno); while ( fread(&c, sizeof(c), 1, fpt) && strcmp(cno,c.name) );Name : Navin Thapa Page 43
  • 44. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 ch=strcmp(cno,c.name); if(ch!=0) { clrscr(); border(); sound(500);delay(200);nosound(); gotoxy(28,13); printf("<<--RECORD NOT FOUND-->>"); getch(); menu(); } else { clrscr(); border(); gotoxy(28,2); printf("<<==SEARCH SUCCESSFUL==>>"); list(); //display the record getch(); menu(); } fclose(fpt);}Name : Navin Thapa Page 44
  • 45. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164void list(){ gotoxy(22,15); printf("id. :%d",c.id); gotoxy(22,17); printf("Full Name :%s",c.name); gotoxy(22,19); printf("Class :%s",c.cls); gotoxy(22,21); printf("Section :%s",c.section); gotoxy(22,23); printf("Address :%s",c.address); gotoxy(22,25); printf("Email Address :%s",c.email); gotoxy(22,27); printf("Roll No. :%s",c.rollno); gotoxy(22,29); printf("Phone No. :%s",c.phoneno);}Name : Navin Thapa Page 45
  • 46. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164void del(){ int ch; char cno[20]; clrscr(); border(); fpt=fopen("addressb.dat","rb+"); gotoxy(20,13); printf("ENTER STUDENTS FULL NAME:"); checkString(cno); while ( fread(&c, sizeof(c), 1, fpt) && strcmp(cno,c.name) ); ch=strcmp(cno,c.name); if(ch!=0) { clrscr(); sound(500);delay(200);nosound(); border(); gotoxy(28,13); printf("<<--RECORD NOT FOUND-->>"); getch(); menu();Name : Navin Thapa Page 46
  • 47. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 } else //Here the saved record is displayed. { clrscr(); border(); gotoxy(28,2); printf("<<==SEARCH SUCCESSFUL==>>"); list(); //display the record gotoxy(30,36); printf("PRESS ANY KEY TO DELETERECORD....."); getch(); empty(); //this is a Function which will erase the recordin memory & NOT physically. fseek(fpt, ftell(fpt) - sizeof(c), 0); fwrite(&c, sizeof(c), 1, fpt); clrscr(); border(); sound(500);delay(200);nosound(); gotoxy(33,13); printf("RECORD DELETED !!!"); getch();Name : Navin Thapa Page 47
  • 48. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 } menu(); fclose(fpt);}void empty(){ strcpy(c.id," "); strcpy(c.name," "); strcpy(c.cls," "); strcpy(c.section," "); strcpy(c.address," "); strcpy(c.email," "); strcpy(c.rollno," "); strcpy(c.phoneno," ");}void modify(){ int ch; char cno[20]; fpt=fopen("addressb.dat","rb+"); border(); gotoxy(20,13);Name : Navin Thapa Page 48
  • 49. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 printf("Enter Students Full Name:"); checkString(cno); while ( fread(&c, sizeof(c), 1, fpt) && strcmp(cno,c.name) ); ch=strcmp(cno,c.name); if(ch!=0) { clrscr(); sound(500);delay(200);nosound(); border(); gotoxy(28,13); printf("<<--RECORD NOT FOUND-->>"); getch(); menu(); } else { clrscr(); gotoxy(28,10); list(); // This will print the old record already stored. printf("<<<==OLD RECORD==>>>"); gotoxy(30,39); printf("Press any key to modify the record..."); getch();Name : Navin Thapa Page 49
  • 50. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 clrscr(); rec(); // this will ask to enter new record fseek(fpt, ftell(fpt) - sizeof(c),0); fwrite(&c, sizeof(c), 1, fpt); //The new name will beadded to the record. gotoxy(38,39); printf("RECORD SAVED !!!"); getch(); } fclose(fpt); menu();}void rec(){ //gotoxy(26,5);printf("Please enter Following Information: "); border(); gotoxy(22,15); printf("id. %d",c.id); gotoxy(22,17);printf("Full name :"); gotoxy(22,19);printf("Class :");Name : Navin Thapa Page 50
  • 51. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 gotoxy(22,21);printf("Section :"); gotoxy(22,23);printf("Address :"); gotoxy(22,25);printf("Email Address :"); gotoxy(22,27);printf("Roll No. :"); gotoxy(22,29);printf("Phone No. :"); fflush(stdin); do { gotoxy(39,17); checkString(c.name); fflush(stdin); }while(checkChar(c.name)!=1); gotoxy(39,19); checkString(c.cls); fflush(stdin); gotoxy(39,21); checkString(c.section); fflush(stdin); gotoxy(39,23); checkString(c.address);Name : Navin Thapa Page 51
  • 52. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 fflush(stdin); gotoxy(39,25); checkString(c.email); fflush(stdin); gotoxy(39,27); checkString(c.rollno); fflush(stdin); gotoxy(39,27); check_phone(c.phoneno, PH); fflush(stdin); getch();}void border(){ int i; window(1,1,76,50); textbackground(BLACK); textcolor(LIGHTGRAY); clrscr(); gotoxy(24,2);Name : Navin Thapa Page 52
  • 53. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 for(i=10;i<=70;i++) { gotoxy(i,4); printf("Ü"); gotoxy(71,4); printf("Ü"); gotoxy(69,47); printf("ß"); gotoxy(71,47); printf("ß"); gotoxy(i,47); printf("ß"); } for(i=5;i<=46;i++) { gotoxy(9,i); printf("ÞÞ "); gotoxy(70,i); printf("ÞÞ"); }} void checkString(char *store)Name : Navin Thapa Page 53
  • 54. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164{ char input[100]; int count=0; do { _setcursortype(_SOLIDCURSOR); fflush(stdin); input[count]=getch(); if(input[count]==8) { if(count>0) { cprintf("%c",8); cprintf("%c",32); cprintf("%c",8); input[count-1]=0; count--; } } else if(input[count]==13) { if(count>0) { input[count]=0; //put null at the end of the arrayName : Navin Thapa Page 54
  • 55. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 break; } else { continue; } } else if(input[count]==27) { input[count]=0; break; } else { cprintf("%c",input[count]); count++; //count increases here } if(count>=30) { input[count]=0; break;Name : Navin Thapa Page 55
  • 56. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 } }while(1); strcpy(store,input);}//Function to check valid characterint checkChar(char name[]){ int i=0,len=0; len=strlen(name); for(i=0;i<len;i++) { if(isalpha(name[i])==0 && !isspace(name[i])) { return 0; } } return 1;}//Function to check valid numberint checkDigit(char digit[]){ int i=0,len=0; len=strlen(digit);Name : Navin Thapa Page 56
  • 57. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 for(i=0;i<len;i++) { if(isdigit(digit[i])==0) { return 0; } } return 1;}//Function to check valid phone numbervoid check_phone(char *ph, int size){ int p=0; char s[20],ch; do { ch=getch(); if( ((ch>=0 && ch<=9)||(ch==-)) && (p<size-1) ) { *ph=ch; ph++; p++;Name : Navin Thapa Page 57
  • 58. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 printf("%c",ch); } else if( (ch==8)&&(p>0) ) { printf("%c%c%c",8,32,8); p--; ph--; } }while(ch!=13 || p<size-1); s[p]=0; *ph=0;}// funcation to genaret auto numberint generateId(){ int max=0,flag=0; int i=0,count=0; int arrmax[100];Name : Navin Thapa Page 58
  • 59. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 fpt=fopen("addressb.dat","rb+"); while(fread(&c,sizeof(c),1,fpt)!=0) { arrmax[i]=c.id; //putting the value read from file to array i++; flag=1; } fclose(fpt); // picking up maximum id if(flag==1) { max=arrmax[0]; for(count=0;count<(i-1);count++) { if(arrmax[count]>max) { max=arrmax[count]; } } } else max=0; return max+1;Name : Navin Thapa Page 59
  • 60. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164}void drawoutbox(int x1, int y1, int x2,int y2, int color ){ int i=1; textcolor(color); gotoxy(x1,y1); //topleft corner cprintf("%c",206); for(i=x1+1;i<x2;i++) { //horizontal line between topleft and topright gotoxy(i,y1); cprintf("%c",205); } gotoxy(x2,y1); //topright corner cprintf("%c",206); for(i=y1+1;i<y2;i++) { //vertical line between topleft and bottomleft gotoxy(x1,i); cprintf("%c",186); } for(i=y1+1;i<y2;i++) { //vertical line between topright and bottomrightName : Navin Thapa Page 60
  • 61. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 gotoxy(x2,i); cprintf("%c",186); } gotoxy(x1,y2); //bottomleft corner cprintf("%c",206); for(i=x1+1;i<x2;i++) { //horizontal line between bottomleft and bottomright gotoxy(i,y2); cprintf("%c",205); } gotoxy(x2,y2); //bottomright corner cprintf("%c",206);}/*Log Out*/void callExit(){ clrscr(); gotoxy(25,20); cprintf("You are out of the System");Name : Navin Thapa Page 61
  • 62. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 gotoxy(21,25); cprintf("Press Any Key to Continue to Exit Program"); getch(); exit(0);}Name : Navin Thapa Page 62
  • 63. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 7)Program Testing :7.1) Test Plan: S. no. Test objective 1 To check whether program runs or not 2 To check if the password display menu takes password or not 3 To check if message “no of attempts 2”, “no of attempts 1” and “ No permission to enter the system!!” displayed when incorrect password or user name is entered in the login form for the first, second and third times respectively. 4 To check if the program menu displays all menu options or not. 5 To check if the all options are right or not. 6 To check if the adding of Student records are stored or not. 7 To check if the option in the main menu shows display record. 8 To check if the Delete Record option is using or not 9 To check if the Modify option in the main menu works properly or not. . 10 To check if the student information and program title is displayed in main page or not. 11 To check the modify record is viewed or not 12 To check if the Exit options works or not. 13 To check after completion of entering records there is next option to enter another record or not. 14 To check whether menu is return back or not 15 To check if the search option in the menu works correctly or not. 16 To check if the given menu items all functions or not. 17 To check if the entry phone no accept Number only or not. 18 To check if the Graphics box and color text are displayed or not. 19 To check whether full name accepts alphabet or not 20 To check whether main menu is opened or not when correct username and password is enteredName : Navin Thapa Page 63
  • 64. Project: ’C’ Programming (CPG 102)Student ID: 1801T30901647.2) Test and Results:Test Case 1Test Objective To check whether program runs or notTest data Running the programExpected Result Main screen should display successfullyTest Result Main screen appear correctlyConclusion Expected result matches actual resultTest Case 2Objective To check if the password display menu takes password or notTest data Input dataExpected Result Input should be takenTest Result Password inputs are entered successfullyConclusion Display of charater should match with input recordName : Navin Thapa Page 64
  • 65. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Test Case 3Test Objective To check if message “no of attempts 2”, “no of attempts 1” and “ No permission to enter the system!!” displayed when incorrect password or user name is entered in the login form for the first, second and third times respectively.Test data Enter the invalid user name or password for three times.Expected Result The program should display the message “No. of attempts remain:2” when invalid entry is done for the first time and “No. of attempts remain:1” when invalid entry is done for second time and “No permission to enter the system!!” when invalid entry is done for the third time.Test Result The program displays the message “No. of attempts remain:2” when invalid entry is done for the first time and “No. of attempts remain:1” when invalid entry is done for second time and “No permission to enter the system!!” when invalid entry is done for the third time.Conclusion Expected result matches actual resultTest Case 4Objective To check if the program menu displays all menu options or not.Test data Open the main menuExpected Result All the options should be displayed correctlyTest Result Menu options are displayed in right orderConclusion Expected result matches actual resultName : Navin Thapa Page 65
  • 66. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Test Case 5ObjectiveTest Case To check if the all options are right or not. 6Test dataObjective Open the main menu of Student records are stored or not. To check if the addingTest data ResultExpected Enter the record All the options should be displayed correctly with serial orderTest ResultExpected Result Menu options are displayed in right order The file entered should be displayed.ConclusionTest Result The record was displayed. Expected result matches actual resultConclusion Expected result matches actual resultTest Case 7ObjectiveTest Case To check if the option in the main menu shows display record. 9Test dataObjective Press 2 for displaying record in the main menu works properly To check if the Modify option or not. .Test data ResultExpected The record should display list of record Enter the desire name to modifyTest ResultExpected Result The record was displayed. be displayed Successful Message shouldTest ResultConclusion The message was displayed Expected result matches actual resultConclusionTest Case 8 Expected result matches actual resultObjective To check if the Delete Record option is using or notTest data Enter the desire name to deleteExpected Result “Deleted successfully” should be displayedTest Result The message was displayedConclusion Expected result matches actual resultName : Navin Thapa Page 66
  • 67. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Test Case 10ObjectiveTest Case To check if the student information and program title is displayed in main 12 page or not.ObjectiveTest data To check if the Exit options works or not. Run the programTest data ResultExpected Display exit options inwith main menu. Choose of main page the student’s information with program title.Test ResultExpected Result Student’s information with program title in main page was displayed. “Thank you!!” message should be displayedConclusionTest Result The message was displayed Expected result matches actual resultConclusionTest Case 11 Expected result matches actual resultObjective To check the modify record is viewed or notTest data Go to display optionsExpected Result Updated record should be displayed with removal of old oneTest Result New updated record was displayed.Conclusion Expected result matches actual resultTest Case 13ObjectiveTest Case To check after completion of entering records there is next option to enter 15 another record or not.ObjectiveTest data To check if the field option in Enter the wholesearchof record the menu works correctly or not.Test data Result Enter youcorrect full-name of the desire student to bebe displayedExpected “ Do the want to add more?(Y/N)” message should searched.Expected ResultTest Result The message was displayed correctly. Record should be displayedTest ResultConclusion The record was displayed Expected result matches actual resultConclusionTest Case 14 Expected result matches actual resultObjective To check whether menu is return back or notTest data Choose all options in the main menu and return to menu.Expected Result Menu should return back.Test Result Menu was shown.Conclusion Expected result matches actual resultName : Navin Thapa Page 67
  • 68. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Test Case 16ObjectiveTest Case To check if the given menu items all functions or not. 18Test dataObjective Go check if the the options in the menu and check them or not. To through all Graphics box and color text are displayedTest data ResultExpected Enter the programshould be defined correctly All the functions thoroughly.Test ResultExpected Result All of the options was correctly functioning in each from main page to Boxes and colors of text should be different Menus.ConclusionTest Result Colors and boxes are seen. Expected result matches actual resultTest CaseConclusion 17 Expected result matches actual resultObjective To check if the entry phone no accept Number only or not.Test data Try both alphabet and numbers while entering the phone no.Expected Result Only numbers should be entered.Test Result Numbers are successfully entered not the alphabets.Conclusion Expected result matches actual resultTest Case 19Objective To check whether full name accepts alphabet or notTest data Enter the name fieldExpected Result Only alphabets should be taken rather than numbersTest Result Alphabets are accepted by the full name fieldConclusion Expected result matches actual resultTest Case 20Objective To check whether main menu is opened or not when correct username and password is enteredTest data Enter the correct password and username in log screen system.Expected Result Menu should be displayed.Test Result Menu was displayed after the successful logged in.Conclusion Expected result matches actual resultName : Navin Thapa Page 68
  • 69. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Results: 1 To check whether program runs or not Successful 2 To check if the password display menu takes password or not Successful 3 To check if message “no of attempts 2”, “no of attempts 1” and “ No Successful permission to enter the system!!” displayed when incorrect password or user name is entered in the login form for the first, second and third times respectively. 4 To check if the program menu displays all menu options or not. Successful 5 To check if the all options are right or not. Successful 6 To check if the adding of Student records are stored or not. Successful 7 To check if the option in the main menu shows display record. Successful 8 To check if the Delete Record option is using or not Successful 9 To check if the Modify option in the main menu works properly Successful or not. . 10 To check if the student information and program title is displayed in Successful main page or not. 11 To check the modify record is viewed or not Successful 12 To check if the Exit options works or not. Successful 13 To check after completion of entering records there is next option to Successful enter another record or not. 14 To check whether menu is return back or not Successful 15 To check if the search option in the menu works correctly or not. Successful 16 To check if the given menu items all functions or not. Successful 17 To check if the entry phone no accept Number only or not. Successful 18 To check if the Graphics box and color text are displayed or not. Successful 19 To check whether full name accepts alphabet or not Successful 20 To check whether main menu is opened or not when correct Successful username and password is enteredName : Navin Thapa Page 69
  • 70. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 8)Implementation: Configuration for hardware and software: It doesn’t need any additional hardware or software to operate the program, but the following requirements should be strongly maintained: Requirements for hardware: 1. Pentium II and higher. 2. 512MB of RAM or higher. 3. 800MHz processor or above. 4. CD ROM. 5. 20 MB of hard disk space. Requirements for software: 1. Operating System WINDOWS 98 or higher 2. Program Turbo C++ needs to be installed. 3. The content of BGI files in the folder TC needs to be copied in the BIN folder for functioning of graphical attributes.Name : Navin Thapa Page 70
  • 71. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Name : Navin Thapa Page 71
  • 72. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 9)User Manual : Insert the program CD into the CD ROM.  Open the CD drive from my computer.  Open the folder labeled C project.  To run program open CPG102~1.EXE file.  Navigate inside the program through provided options. The main page of this system will open in the screen like : Press any key to continue to navigate through log-screen .Name : Navin Thapa Page 72
  • 73. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Name : Navin Thapa Page 73
  • 74. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 1)The following screen appears with username and password.Type username : admin Password: passNow, you are successfully logged in.Name : Navin Thapa Page 74
  • 75. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Then, you will navigate through the main menu of the program. In the main menu there is listof the program from 1-6.To select the option in given in the menus go to the bottom and typeany number which you want to open.Name : Navin Thapa Page 75
  • 76. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164If you choose ‘1’, then you will enter through adding new record of the student like as below:You should fill up all the fields like name, class, roll no. section etc., with correct characters.You cannot left or empty the fields. After filling all the fields, you are asked whether to addmore records or not. Press ‘Y’ for Yes or simply ‘N’ No.Then, you will be navigate through the main menu again.Name : Navin Thapa Page 76
  • 77. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Now, if you choose ‘2’, display record panel will be opened and shows the existing recordsof the students. Press any key to view next record serially. If you haven’t entered any record,then the display record panel will be silent i.e it will not be opened.Here is some records which have been entered already. Press key to view next student’srecord. After viewing all the records you will directly jumped to the main menu again.Name : Navin Thapa Page 77
  • 78. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Now, if you choose ‘3’ option, Modify record panel will be opened.You have to enter the desire student’s full name to modify his/her record. After modifyingcertain fields of the student, then the “record saved” message is appeared. Now you can pressany key to go to main menu again.Name : Navin Thapa Page 78
  • 79. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164If you choose ‘4’ option, you will navigate through Delete record panel, where you have toenter the student’s full name which have to be deleted from the system.After typing correct name, the record is shown and press any key to delete the record. Afterthe deletion of record, you are asked to press any key to go to main menu.Name : Navin Thapa Page 79
  • 80. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Now, if you choose ‘5’ options, you will enter through the Search and view panel, where youhave to enter the student’s full name to view the records.Here is the simple record of the student named “Baba”. Now you can press any key to go tomain menu.Name : Navin Thapa Page 80
  • 81. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164Now you have only one option left i.e, ‘6’. This option is for exit from the system.After pressing ‘6’, you will be successfully logout from the Student Management System.Name : Navin Thapa Page 81
  • 82. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 10)Conclusion : 10.1) Program Weakness: As we know that, no any program can be 100% reliable and efficient. So, there are also some drawbacks from my system which are as follows:  It cannot perform all the required functions as of professional one, it’s simply a record keeping of student of the school level.  System is not sharply a graphical user interface. There is just use of some text- color and borders.  Its not a multipurpose and multitasking program. It can’t perform various task at a single time.10.2) Program Strengths:There are many advantages of using this program as it contains various features like:  It is actually a user-friendly software, as it is easy to use by just following the instructions which are appeared on the screen.  This program has a login system, so that only authorized users are only allowed to accessed through the internal main system.  Once a record has been saved, duplicate record can’t be made. All the record have unique id so that there will no t be any misplace of the records entered.  Input name should matched the name entered already in the system in-order to perform deletion, modification and searching, so that record will be safe totally.10.3) Program Enhancement:Users can add extra enhancements in the system as per necessity in the future for fulfillmentof their requirements.  Users can add fees billing system in the program .  Viewing all records without entering name can be made.  For security purpose, advanced encryption techniques can be applied.Name : Navin Thapa Page 82
  • 83. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164  Graphical interface can be added to make user friendly appliance. 11)Acknowledgement : I would like to thank Mr. Deepak Kumar Karna for giving us an outstanding guidance and co-operation for designing this system. I’ve successfully developed this system through his idea and beliefs. And last I want to thanks informatics education for giving me this opportunity to build up an application by the use of C programming.Name : Navin Thapa Page 83
  • 84. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 12)References : Books:-Programming in ANSI C by E Balagurusamy.-Informatics study guideWebsites:-http://gd.tuwien.ac.at/languages/c/programming-bbrownName : Navin Thapa Page 84
  • 85. Project: ’C’ Programming (CPG 102)Student ID: 1801T3090164 13)Turnitin Report:Name : Navin Thapa Page 85