INTRODUCTION

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

INTRODUCTION :

Student report card system project in C is a simple console application built


without the use of graphics. In this project, users can perform typical report
card related functions like adding a new student record and displaying,
modifying, editing and deleting it. File handling has been effectively used to
perform all these. This project will teach you how to use file handling in C, add,
read, display, search, modify and delete record from file.

OBJECTIVE :

File handling has been used for the effective implementation of all the typical
features of this project. The key features of Student Report Card System are:

1. Adding student information: This feature creates a new student record


containing his marks. For this the information to be provided are the name
and ID no. of the student, and the marks obtained by him/her in 4 subjects
– Data Structure, Discrete Mathematics, Electrical Circuit and Differential
Equation.
2. Delete student record: This feature deletes the report card record of a
particular student; it first of all asks for the ID no. of the student whose
record is to be deleted.
3. Displaying all students information: The void insertion() function in
this student report card system project in C has been used for this feature.
It basically shows the progress report of all the students added in file. This
feature displays the ID no. and name of all the students, the marks
obtained by them in 4 subjects – Data Structure, Discrete Mathematics,
Electrical Circuit and Differential Equation along with the percentage and
grade of each student.
4. Displaying specific student’s information: This feature is same as the
one explained above, except it shows the progress report and relevant data
related to a particular student.
5. Display all students’ grade report: This feature enlists all the students’
record saved in file. The grade report is displayed in a tabular form with ID
no. and name of the students, marks achieved in the four subjects, and the
grade and percentage obtained by them.

Header Files Used:

Student report card system is a very simple project that runs with just four header
files. Here, are the header files required for this project:

 #include<stdio.h>
 #include<conio.h>
 #include<string.h>
 #include<stdlib.h>

DESCRIPTION :

We have used many function in this project for proper program execution work. These function easy to
understand by their name.

 Int main{} = This is main function of our project. Every function call from main function.
 float final{} = This function used for show the specific result of students. This function call from
the main function.
 float grade{} = This function store the student exam grades and this function call from the main
function.
 void insertion{} = This function used for show every students result with specific subjects and
mark. This function also call from main function.
 void printall{} = This function store all students record. And it's called from main function also.
 id search{} = This function used for search specific data from the student record and also called
from main function.
 int help{} = This function used for check record empty or not. It’s called from main function.
 void delete{} = This function used for delete specific data from the records. It’s also called from
main function.
 void main2{} = This function used for display all the options from student records like Add new
records, delete record, show specific students info, all students info. It’s also called from main
function.

Requirement Specification :

Our Requirement Specification is built a program for student report card using a suitable data structure
.The student report card display detail student information and their result..The specification is –

* For Adding Student Information.

* For Deleting Student Information.

* For Displaying All Student Information.

* For Displaying Specific Student Information.

* For Closing The Program

Source Code :

#include<stdio.h>

#include<conio.h>

#include<string.h>

#include<stdlib.h>

typedef struct src

char name[30];

char id[15];

float marksds;

float marksec;

float marksdm;

float marksde;

float gpds;
float gpec;

float gpdm;

float gpde;

char gradeds[3];

char gradeec[3];

char gradedm[3];

char gradede[3];

char commentds[20];

char commentec[20];

char commentdm[20];

char commentde[20];

float gp;

char comment[30];

struct src *ptr;

} src;

src *head=NULL,*temp,*x;

float final(char c[],float a,float b,float i,float j)

float e=(a+b+i+j)/4;

if(e==4.00)

strcpy(c,"Outstanding");
}

else if(e<4.00&&e>=3.75)

strcpy(c,"Excellent");

else if(e<3.75&&e>=3.50)

strcpy(c,"Very Good");

else if(e<3.50&&e>=3.25)

strcpy(c,"Good");

else if(e<3.25&&e>=3.00)

strcpy(c,"Satisfactory");

else if(e<3.00&&e>=2.75)

strcpy(c,"Above Average");

else if(e<2.75&&e>=2.50)

strcpy(c,"Average");

else if(e<2.50&&e>=2.25)

strcpy(c,"Bellow Average");
}

else if(e<2.25&&e>=2.00)

strcpy(c,"Pass");

else if(e<2.00&&e>=0.00)

strcpy(c,"Fail");

return e;

float grade(char c[],char d[],float a)

if(a>=80&&a<=100)

strcpy(c,"A+");

strcpy(d,"Outstanding");

return 4;

else if(a>=75.00&&a<=79.00)

strcpy(c,"A");

strcpy(d,"Excellent");

return 3.75;

else if(a>=70&&a<=74)

{
strcpy(c,"A-");

strcpy(d,"Very Good");

return 3.50;

else if(a>=65&&a<=69)

strcpy(c,"B+");

strcpy(d,"Good");

return 3.25;

else if(a>=60&&a<=64)

strcpy(c,"B");

strcpy(d,"Satisfactory");

return 3;

else if(a>=55&&a<=59)

strcpy(c,"B-");

strcpy(d,"Avobe Average");

return 2.75;

else if(a>=50&&a<=54)

strcpy(c,"C+");

strcpy(d,"Average");

return 2.50;

}
else if(a>=45&&a<=49)

strcpy(c,"C");

strcpy(d,"Bellow Average");

return 2.25;

else if(a>=40&&a<=44)

strcpy(c,"D");

strcpy(d,"Pass");

return 2;

else if(a>=0&&a<=39)

strcpy(c,"F");

strcpy(d,"Fail");

return 0;

void insertion()

while(1)

x=(src*)malloc(sizeof(src));

printf("\nEnter The Name: ");

scanf(" %[^\n]s",&x->name);
printf("Enter The Id : ");

scanf(" %[^\n]s",&x->id);

printf("\nEnter The Marks:\n");

printf("----------------\n");

printf("Marks For Data Structure : ");

scanf("%f",&x->marksds);

x->gpds=grade(x->gradeds,x->commentds,x->marksds);

printf("Marks For Electrical Circuit : ");

scanf("%f",&x->marksec);

x->gpec=grade(x->gradeec,x->commentec,x->marksec);

printf("Marks For Discrete Math : ");

scanf("%f",&x->marksdm);

x->gpdm=grade(x->gradedm,x->commentdm,x->marksdm);

printf("Marks For Differential Equation: ");

scanf("%f",&x->marksde);

x->gpde=grade(x->gradede,x->commentde,x->marksde);

x->gp=final(x->comment,x->gpds,x->gpec,x->gpdm,x->gpde);

x->ptr=NULL;

printf("-------------------------------------------------------------------------------");

if(head==NULL)

{
head=x;

else

temp=head;

while(temp->ptr!=NULL)

temp=temp->ptr;

temp->ptr=x;

printf("\t\t\tContinue Getting Information(Y/N)");

printf("\n-------------------------------------------------------------------------------");

char ch=getch();

if(ch=='N'||ch=='n')

break;

main2();

void printall()

int c;

printf("\n ----------");

printf("\n ALL RECORD:");


printf("\n ----------");

temp=head;

if(temp==NULL)

printf("\n\t\t\tRecord Empty.\n");

while(temp!=NULL)

printf("\n Student Name: %s\n Student Id : %s\n\n",temp->name,temp->id);

printf(" Course Title\t\t Grade\t Grade Point\t Comment\n");

printf(" ------------\t\t -----\t -----------\t -------\n");

if(temp->gradeds[1]=='+'||temp->gradeds[1]=='-')

printf(" Data Structure\t\t %s %.2f %s\n",temp->gradeds,temp->gpds,temp-


>commentds);

else

printf(" Data Structure\t\t %s %.2f %s\n",temp->gradeds,temp->gpds,temp-


>commentds);

if(temp->gradeec[1]=='+'||temp->gradeec[1]=='-')

printf(" Electrical Circuit\t %s %.2f %s\n",temp->gradeec,temp->gpec,temp-


>commentec);

}
else

printf(" Electrical Circuit\t %s %.2f %s\n",temp->gradeec,temp->gpec,temp-


>commentec);

if(temp->gradedm[1]=='+'||temp->gradedm[1]=='-')

printf(" Discrete Math \t\t %s %.2f %s\n",temp->gradedm,temp->gpdm,temp-


>commentdm);

else

printf(" Discrete Math \t\t %s %.2f %s\n",temp->gradedm,temp->gpdm,temp-


>commentdm);

if(temp->gradede[1]=='+'||temp->gradede[1]=='-')

printf(" Differential Equation\t %s %.2f %s\n\n",temp->gradede,temp->gpde,temp-


>commentde);

else

printf(" Differential Equation\t %s %.2f %s\n\n",temp->gradede,temp->gpde,temp-


>commentde);

printf("\n\t\t\t SGPA= %.2f\t\t %s\n",temp->gp,temp->comment);

temp=temp->ptr;

printf("-------------------------------------------------------------------------------\n");
}

printf("\n-------------------------------------------------------------------------------\n");

printf("\t\t\tMAIN MENU OR TERMINATE(M/T)");

printf("\n-------------------------------------------------------------------------------\n");

char ch=getch();

if(ch=='M'||ch=='m')

main2();

void search()

int b=0;

char d[30];

printf("\nEnter The Id: ");

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

printf("-------------------------------------------------------------------------------\n");

temp=head;

while(temp!=NULL)

if(strcmp(temp->id,d)==0)

b=1;

break;
}

else

temp=temp->ptr;

if(b==0)

printf("Record Not Found\n");

else

printf("\n Student Name: %s\n Student Id : %s\n\n",temp->name,temp->id);

printf(" Course Title\t\t Grade\t Grade Point\t Comment\n");

printf(" ------------\t\t -----\t -----------\t -------\n");

if(temp->gradeds[1]=='+'||temp->gradeds[1]=='-')

printf(" Data Structure\t\t %s %.2f %s\n",temp->gradeds,temp->gpds,temp-


>commentds);

else

printf(" Data Structure\t\t %s %.2f %s\n",temp->gradeds,temp->gpds,temp-


>commentds);

if(temp->gradeec[1]=='+'||temp->gradeec[1]=='-')
{

printf(" Electrical Circuit\t %s %.2f %s\n",temp->gradeec,temp->gpec,temp-


>commentec);

else

printf(" Electrical Circuit\t %s %.2f %s\n",temp->gradeec,temp->gpec,temp-


>commentec);

if(temp->gradedm[1]=='+'||temp->gradedm[1]=='-')

printf(" Discrete Math \t\t %s %.2f %s\n",temp->gradedm,temp->gpdm,temp-


>commentdm);

else

printf(" Discrete Math \t\t %s %.2f %s\n",temp->gradedm,temp->gpdm,temp-


>commentdm);

if(temp->gradede[1]=='+'||temp->gradede[1]=='-')

printf(" Differential Equation\t %s %.2f %s\n\n",temp->gradede,temp->gpde,temp-


>commentde);

else

printf(" Differential Equation\t %s %.2f %s\n\n",temp->gradede,temp->gpde,temp-


>commentde);

}
printf("\n\t\t\t SGPA= %.2f\t\t %s\n",temp->gp,temp->comment);

printf("-------------------------------------------------------------------------------\n");

printf("-------------------------------------------------------------------------------\n");

printf("\t\t\tMAIN MENU OR CONTINUE(M/C)");

char ch=getch();

if(ch=='C'||ch=='c')

printf("\n-------------------------------------------------------------------------------\n");

search();

else

main2();

int help(char d[])

int b=0;

temp=head;

while(temp!=NULL)

if(strcmp(temp->id,d)==0)

b=1;

break;

}
else

temp=temp->ptr;

return b;

void delete()

char d[30];

int b=0,c;

src *temp1;

printf("\nEnter The Id: ");

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

printf("----------------\n");

c=help(d);

if(c==0)

printf(" Unsuccesful\n");

goto bue;

temp=head;

if(strcmp(head->id,d)==0)

head=head->ptr;
free(temp);

b=1;

temp=head;

while(temp!=NULL)

if(strcmp(temp->id,d)==0)

b=1;

temp1->ptr=temp->ptr;

free(temp);

break;

else

temp1=temp;

temp=temp->ptr;

if(b==0)

printf(" Unsuccesful\n");

else

printf(" Succesful\n");

}
bue:

printf("-------------------------------------------------------------------------------\n");

printf("\t\t\tMAIN MENU OR CONTINUE(M/C)");

char ch=getch();

if(ch=='c'||ch=='C')

printf("\n-------------------------------------------------------------------------------\n");

delete();

else

main2();

void main2()

int a;

printf("\n-------------------------------------------------------------------------------");

printf("\n\t 1. For Adding Student Information.\n");

printf("\t 2. For Deleting Student Information.\n");

printf("\t 3. For Displaying All Student Information.\n");

printf("\t 4. For Displaying Specific Student Information.\n");

printf("\t 5. For Closing The Program");

printf("\n-------------------------------------------------------------------------------");

printf("\nChoose The Operation: ");


scanf(" %d",&a);

printf("-------------------------------------------------------------------------------");

if(a==1)

insertion();

else if(a==2)

delete();

else if(a==3)

printall();

else if(a==4)

search();

else if(a==5)

return 0;

int main()

system("COLOR 0B");
printf("\t\t\t---------------------\n");

printf("\t\t\t STUDENT REPORT CARD\n");

printf("\t\t\t---------------------\n");

main2();

return 0;

Sample Input & Output :

---------------------

STUDENT REPORT CARD

---------------------

-------------------------------------------------------------------------------

1. For Adding Student Information.

2. For Deleting Student Information.

3. For Displaying All Student Information.

4. For Displaying Specific Student Information.

5. For Closing The Program

-------------------------------------------------------------------------------

Choose The Operation: 1

-------------------------------------------------------------------------------

Enter The Name: Tanjia afrin sara

Enter The Id : 182-15-11358

Enter The Marks:

----------------
Marks For Data Structure : 87

Marks For Electrical Circuit : 65

Marks For Discrete Math : 72

Marks For Differential Equation: 73

------------------------------------------------------------------------------- Continue Getting Information(Y/N)

-------------------------------------------------------------------------------

Enter The Name: Shehab Chawdhury

Enter The Id : 182-15-11396

Enter The Marks:

----------------

Marks For Data Structure : 92

Marks For Electrical Circuit : 89

Marks For Discrete Math : 75

Marks For Differential Equation: 81

------------------------------------------------------------------------------- Continue Getting Information(Y/N)

-------------------------------------------------------------------------------

Enter The Name: Sorav Sen

Enter The Id : 182-15-11392

Enter The Marks:

----------------

Marks For Data Structure : 78

Marks For Electrical Circuit : 84

Marks For Discrete Math : 64

Marks For Differential Equation: 73

------------------------------------------------------------------------------- Continue Getting Information(Y/N)

-------------------------------------------------------------------------------

Enter The Name: Masud Siddique


Enter The Id : 182-15-11471

Enter The Marks:

----------------

Marks For Data Structure : 85

Marks For Electrical Circuit : 65

Marks For Discrete Math : 59

Marks For Differential Equation: 91

------------------------------------------------------------------------------- Continue Getting Information(Y/N)

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------

1. For Adding Student Information.

2. For Deleting Student Information.

3. For Displaying All Student Information.

4. For Displaying Specific Student Information.

5. For Closing The Program

-------------------------------------------------------------------------------

Choose The Operation: 2

-------------------------------------------------------------------------------

Enter The Id: 182-15-11358

----------------

Succesful

-------------------------------------------------------------------------------

MAIN MENU OR CONTINUE(M/C)

-------------------------------------------------------------------------------

1. For Adding Student Information.

2. For Deleting Student Information.

3. For Displaying All Student Information.

4. For Displaying Specific Student Information.


5. For Closing The Program

-------------------------------------------------------------------------------

Choose The Operation: 3

-------------------------------------------------------------------------------

----------

ALL RECORD:

----------

Student Name: Shehab Chawdhury

Student Id : 182-15-11396

Course Title Grade Grade Point Comment

------------ ----- ----------- -------

Data Structure A+ 4.00 Outstanding

Electrical Circuit A+ 4.00 Outstanding

Discrete Math A 3.75 Excellent

Differential Equation A+ 4.00 Outstanding

SGPA= 3.94 Excellent

-------------------------------------------------------------------------------

Student Name: Sorav Sen

Student Id : 182-15-11392

Course Title Grade Grade Point Comment

------------ ----- ----------- -------

Data Structure A 3.75 Excellent

Electrical Circuit A+ 4.00 Outstanding

Discrete Math B 3.00 Satisfactory


Differential Equation A- 3.50 Very Good

SGPA= 3.56 Very Good

-------------------------------------------------------------------------------

Student Name: Masud Siddique

Student Id : 182-15-11471

Course Title Grade Grade Point Comment

------------ ----- ----------- -------

Data Structure A+ 4.00 Outstanding

Electrical Circuit B+ 3.25 Good

Discrete Math B- 2.75 Avobe Average

Differential Equation A+ 4.00 Outstanding

SGPA= 3.50 Very Good

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------

MAIN MENU OR TERMINATE(M/T)

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------

1. For Adding Student Information.

2. For Deleting Student Information.

3. For Displaying All Student Information.

4. For Displaying Specific Student Information.


5. For Closing The Program

-------------------------------------------------------------------------------

Choose The Operation: 4

-------------------------------------------------------------------------------

Enter The Id: 182-15-11396

-------------------------------------------------------------------------------

Student Name: Shehab Chawdhury

Student Id : 182-15-11396

Course Title Grade Grade Point Comment

------------ ----- ----------- -------

Data Structure A+ 4.00 Outstanding

Electrical Circuit A+ 4.00 Outstanding

Discrete Math A 3.75 Excellent

Differential Equation A+ 4.00 Outstanding

SGPA= 3.94 Excellent

-------------------------------------------------------------------------------

-------------------------------------------------------------------------------

MAIN MENU OR CONTINUE(M/C)

-------------------------------------------------------------------------------

1. For Adding Student Information.

2. For Deleting Student Information.

3. For Displaying All Student Information.

4. For Displaying Specific Student Information.

5. For Closing The Program

-------------------------------------------------------------------------------
Choose The Operation: 5

-------------------------------------------------------------------------------

Process returned 0 (0x0) execution time : 268.782 s

Press any key to continue.

CHALLENGES :

CONCLUSION :

This program makes the user simpler to maintaining student’s details and can easily perform operations
on student’s records . This program also reduces the work load of the teachers in school as all the details
are store in computer system and whenever the detail marks of student needed it can be searched and
displayed on the screen .

You might also like