Professional Documents
Culture Documents
Daaproject 170205162546
Daaproject 170205162546
Submitted by
KUMAR ANAND-14SCSE101249
MD TARIQUL AZAM-14SCE101224
GALGOTIAS UNIVERSITY
GREATER NOIDA, GAUTAM BUDDH NAGAR,
UTTAR PRADESH, INDIA
November 2016
1
Certificate
I hereby certify that the work which is being presented in the Project Based Learning (PBL)
entitled, “STUDENT RESULT SYSTEM”, in partial fulfillment of the requirements for the
award of degree of Bachelor in Technology in Computer Science and Engineering submitted in
School of Computing Science and Engineering of Galgotias University, Gr. Noida, is an
authentic record of my own work carried out under the supervision of Ms. SANDEEP KAUR
and refers other researcher’s works which are duly listed in the reference section.
The matter presented in this project has not been submitted for the award of any other degree of
this or any other university.
(Kumar Anand)
(Md Tariqul Azam)
This is to certify that the above statement made by the candidate is correct and true to the best of
my knowledge.
2
Acknowledgement
I would like to take this opportunity to express my profound sense of gratitude and respect to all
those who helped me throughout the duration of this project. GALGOTIAS UNIVERSITY in
particular has been the source of inspiration for me.
I feel privileged to offer my sincere thanks and deep sense of gratitude to supervision of Ms.
Sandeep Kaur as project guide, for expressing his confidence in me by letting me work on a
project of this magnitude and using the latest technologies and providing his support, help &
encouragement in implementing this Project. I would also like to thank Dr. Parmanand,
Professor and Dean, School of Computing Science & Engineering for providing me opportunity
to work on this project.
3
CONTENTS
List of Figures
S.NO. Title Page No.
1. UML DIAGRAM 11
2. OUTPUT (MAIN MENU) 27
3. INSERTION 28
4. DISPLAY 29
5. AVERAGE 30
6. SORTING 31
4
1. INTRODUCTION
1.1 MOTIVATION
In computer science, a Design and Analysis of Algorithm is a particular way of organizing data in
a computer so that it can be used efficiently. It can implement on or more particular Abstract Data
Types (ADT), which are the means of specifying the contract of operations and their complexity. In
comparison, it is a concrete implementation of the contract provided by an ADT.
Data structures provide a means to manage large amounts of data efficiently for uses such as large
databases and internet indexing services. Usually, efficient data structures are key to designing
efficient algorithms. Some formal design methods and programming languages emphasize data
structures, rather than algorithms, as the key organizing factor in software design. Storing and
retrieving can be carried out on data stored in both main memory and secondary memory.
The implementation of a data structures usually requires writing a set of procedures that create and
manipulate instances of that structure. The efficiency of data structure cannot be analyzed separately
from those operations. This observation motivates the theoretical concept of abstract data type, a data
structure that is defined indirectly by the operations that may be performed on it, and mathematical
properties of those operations (including their space and time cost).
To create a Student Result System using ‘C’ Language involving concepts of Searching and
Sorting and its analysis.
This software will contain all the necessary information regarding student’s record.
5
1.3 Objective of Project
The objective of the project is to create a Student Result System to store the Name, Roll no.,
Marks of different student using a linear data structure using C programming.
In this software one can very easily add student’s record, sort student’s record, search student’s
record, compute (using algorithms) and view all student’s records. This application stand out
among all other software in a way that it is user friendly and can be modified easily as per the
requirements. It allows user to add new/view/sort/search records.
6
2. LITERATURE SURVEY
The Student Database System is the software that enables user to easily store and find
record’s information such as name, roll no and marks. There are record-centric databases
(database.txt and record.txt) that provide a fully integrated approach to store information
from user and communicate with the software.
Also, it is console based software so we cannot use attractive features which are used in
window, web or mobile application.
The use of linear search in file handling might increase the time complexity.
7
2.3 PROPOSED APPROACH AND ITS JUSTIFICATION
The Student Database System may be chosen because it is thought to provide following
advantages: -
8
ANALYSIS
*Windows XP/VISTA/7/8/8.1/10
*Memory Space: Minimum 250 Mb
*RAM: Minimum 256 Mb
*Processor: Pentium 1, Pentium 2, Celeron, Intel core 2 duos
*Compiler: Turbo C3
The Merge sort has complexity of n(logn) for all the cases. So, it requires same time to execute
irrespective of the position and value of elements.
The linear search is also used along with file handling which looks for the record in the list
provided by user and then performs the operation according to the requirement.
DESIGN
4.1 INTRODUCTION
A Student Result System is usually used in schools/colleges for storing records of students.
All student information can be stored and different operations can be performed on it through
database.
10
11
IMPLEMENTATION AND RESULTS
Student Result System is simple small software in C. It is similar to actual database of records.
It performs Insertion, Searching, Sorting and other operations on records.
The merge sort technique has been used for sorting marks and roll number. The linear search is
along file handling for searching and insertion.
5.2METHOD OF IMPLEMENTATION
#include<stdio.h>
#include<conio.h>
#include<fstream.h>
#include<stdlib.h>
#include<string.h>
void insertion();
void display();
void sorting_marks();
void sorting_roll();
void search();
void avmarks();
int marks[100],rollno[100],i,j,arr[100],n;
12
char name[100][50];
FILE *fd,*fr,*d;
void main()
main:
int ch;
while(1)
clrscr();
printf("\n\n\n\t\t\tMAIN MENU\n\t\t=====================");
printf("\n\t\t[8] EXIT\n\t\t=================\n\t\t");
scanf("%d",&ch);
13
switch(ch)
case 1: insertion();
break;
case 2: display();
break;
case 3: search();
break;
case 4: avmarks();
break;
case 5: sorting_marks();
break;
case 6: sorting_roll();
break;
break;
}
14
printf("\n\n\n\t\tENTER THE CHOICE:");
scanf("%d",&ch);
switch (ch)
case 0:
goto main;
case 7:
exit(1);
default:
printf("\nINVALID CHOICE");
break;
char name[50],n[50];
int flag=0;
15
clrscr();
printf("\n===============\nInsertion in Databse\n================\n");
fd=fopen("database.txt","r");
printf("\n\nENTER NAME:");
scanf("%s",name);
scanf("%ld",&roll);
scanf("%ld",&mark);
strcpy(n,name);
a=roll;
while(!feof(fd))
fscanf(fd,"%s %d %d\n",&name[i],&rollno[i],&marks[i]);
if(a==rollno[i])
flag=1;
else
do
if(mark>500)
16
printf("\n\tTotal Marks should not be greater than
500\n\t");
scanf("%ld",&mark);
}while(mark>500);
flag=0;
i=i+1;
fclose(fd);
if(flag==0)
d=fopen("database.txt","a");
fclose(d);
clrscr();
fd=fopen("database.txt","r");
i=0;
17
printf("\n\t\t================================");
printf("\n\t\t================================\n\n");
while(!feof(fd))
fscanf(fd,"%s %d %d\n",&name[i],&rollno[i],&marks[i]);
printf("%s %d %d\n",name[i],rollno[i],marks[i]);
i=i+1;
fclose(fd);
getch();
clrscr();
fd=fopen("database.txt","r");
fr=fopen("record.txt","w");
i=0;
while(!feof(fd))
{
18
fscanf(fd,"%s %d %d\n",&name[i],&rollno[i],&marks[i]);
arr[i]=marks[i];
i=i+1;
n=i;
mergesort(arr,0,n-1);
//printf("%s %d %d \n",name[i],rollno[i],arr[i],"\n");
if(arr[i]==marks[j])
fprintf(fr,"%s %d %d \n",name[j],rollno[j],marks[j],"\n");
fclose(fd);
fclose(fr);
fr=fopen("record.txt","r");
i=0;
19
while(!feof(fr))
fscanf(fd,"%s %d %d\n",&name[i],&rollno[i],&marks[i]);
printf("%s %d %d\n",name[i],rollno[i],marks[i]);
i=i+1;
fclose(fr);
getch();
void sorting_roll()
clrscr();
fd=fopen("database.txt","r");
fr=fopen("record.txt","w");
i=0;
while(!feof(fd))
fscanf(fd,"%s %d %d\n",&name[i],&rollno[i],&marks[i]);
arr[i]=rollno[i];
i=i+1;
20
n=i;
mergesort(arr,0,n-1);
//printf("%s %d %d \n",name[i],arr[i],marks[i],"\n");
if(arr[i]==rollno[j])
fprintf(fr,"%s %d %d \n",name[j],rollno[j],marks[j],"\n");
fclose(fd);
fclose(fr);
fr=fopen("record.txt","r");
i=0;
while(!feof(fr))
fscanf(fd,"%s %d %d\n",&name[i],&rollno[i],&marks[i]);
printf("%s %d %d\n",name[i],rollno[i],marks[i]);
21
i=i+1;
fclose(fr);
getch();
int mid;
if(i<j)
mid=(i+j)/2;
int i,j,k;
k=0;
if(a[i]<a[j])
temp[k++]=a[i++];
else
temp[k++]=a[j++];
temp[k++]=a[i++];
temp[k++]=a[j++];
for(i=i1,j=0;i<=j2;i++,j++)
a[i]=temp[j];
int i,roll,ch,mark,rollno;
char name[50];
23
clrscr();
fd=fopen("database.txt","r");
printf("\n\t\t=========================");
printf("\n\t\t=========================\n\n");
scanf("%d",&rollno);
i=0;
while(!feof(fd))
fscanf(fd,"%s %d %d\n",&name,&roll,&mark);
if(rollno==roll)
printf("%s %d %d\n",name,roll,mark);
break;
else
i=i+1;
fclose(fd);
getch();
24
}
int ma=0,n,i,x=0;
float avg;
clrscr();
printf("\n\t\t================================");
printf("\n\t\t================================\n\n");
fr=fopen("database.txt","r");
i=0;
while(!feof(fr))
fscanf(fr,"%s %d %d\n",&name[i],&rollno[i],&marks[i]);
x=x+marks[i];
arr[i]=marks[i];
i=i+1;
n=i;
avg=x/n;
for(i=0;i<n;i++)
25
{
if(ma<arr[i])
ma=arr[i];
printf("\n\tMaximum Marks:-%d",ma);
fclose(fr);
getch();
26
5.2.2 OUTPUT
MAIN MENU
27
INSERTION
28
DISPLAY
29
AVERAGE AND MAXIMUM
30
SORTING (ON MARKS BASIS)
31
TESTING AND VALIDATION
Apart from some syntax errors, there were some errors in the program like user may enter any
amount of marks. But total subjects is 5, so maximum marks must be <= 500.
Also user may enter records of students who are already present.
It will take duplicate values.
So, we have eliminated all these problem which makes it an effective software.
CONCLUSION
The projects clearly depicts that the Student Result System is very efficient. It shows how
the concept of File Handing can be used in database management system in absence of
databases like Oracle, MySql etc.
Although, this software can be further modified to be used as multitasking and bigger
software, but it effectively works under the condition of limited resources and time.
32
REFERENCE
33