“Student management system”
1. INTRODUCTION:
Our
project is a student management system
project. It includes all details about a syudent studying in college such as
his/her admission info,admission type,courses he/she have enrolled in,etc.
2. AIM :
To
provide a platform for handling students
data and their academic progress.
3. MODULES OF THE PROJECT :
1)Student
information (Name,address,mobile number,email:int/char
type)
2)
Csv(excel)file for storing students data
3)Enrollment
number/Prn_no:string type
4)Name:string
type
5)roll_no
:int type
4.EXPLANATION :
Basic
functioning of the system is registering the students, storing record of
currently studying students ,deleting or
arranging records of previously passout students.This system only allows
faculties to authorize this data .This project helps to create database of
students studying in any organization or institute so it will no more tideous
task to college /university faculties to maintain students information in
various files or creating separate files
to each of them.All students personal info and attendance data is stored in
files so that it will be convenient to access them efficiently.
5.Algorithm/pseudo
code –
A) For main function():
1)start.
Declare
and define functions according to program. )Enter tasks to perform using switch
case in main() function. eg.create().modify(),delete(),etc.
2)For
login and register using switch case for giving choices.
1>login
2>Register
i)For login function:
cout << "Enter your
username\n";
cin >> username;
cout << "Enter your
password\n"; cin >>
password;
ifstream input("data.txt",
ios::app); //storing login
details in data.txt file
while (input.peek() != EOF) {
getline(input >> ws, usr, ',');
getline(input
>> ws, pwd, '\n');
if (username.compare(usr) == 0) { //checking condition as entered
username or password is
correct or not
if (password.compare(pwd) == 0) {state = 1;
cout << "login
successfull!! \n"
<< "welcome
back " << usernam } }
ii)For register function:
Enter username and password for
first time registration and store that credentials into “data.txt “ file as
shown in step 1)
iii) For password reset function:
Input: string password,
name,new ,key, freset;
cout<<"Enter Username
:"; getline(cin>>ws,input);
transform(input.begin(),
input.end(), input.begin(), ::tolower); //converting into lowercase
cout<<"Enter New
Password :"; getline(cin>>ws,neww);
cout<<"Enter Pass reset
key :"; getline(cin>>ws,key);
transform(uname.begin(),
uname.end(), uname.begin(), ::tolower); //converting into lowercase
fin.open("pass.txt"); //opening saved information
of registration credentials file
while(fin.peek()!=EOF){getline(fin,name,',');
getline(fin,password,',');
getline(fin,freset,'\n');
if(name.compare(input)==0){n=i; //Comparing our entered
credentials with
saved credentials
s1=name; s2=password;}
if(key.compare(freset)==0){jj=00;}
f(jj==00){ cout<<"\tPassword rest
succesfull\n";
//If a variable named j==0 then
some error get occur in resetting password and that reset information get
deleted using delete_line function.
delete_line("pass.txt",
n);
ofstream
fout;
fout.open("pass.txt",ios::app);
fout<<s1<<","<<neww<<","<<key<<"\n";
fout.close();}
if(j==1){ cout<<"Wrong passkey\n unable to
reset\n";
//Checking password requirements in resetting
password else we are unable to reset password
//End of password reset function.
3)Input
student information and store it using function create();//for creating student
record.
Input:Name,
Roll_no , prn _no.
Store
all data into csv file which is a database for storing student’s data.//using
ofstream file format for writing data.
4)Search
student record by invoking search()
function call.//using ifstream file
format for reading student data.
i)using
switch case inside search() function definition for giving choice as
search data by roll_no or
search by name.
5)
For modifying or update student
record invoke replacecall() function
which is defined in another cpp file
named “modifycode.cpp” whose haeder file is included in main program.
Control
of program will transfer to modifycode cpp file after we call it from main
function.
B)For modify code/update info of student/for deleting info:
a)
for modifying student info:
1)Function
call “replacecall()”which is under
modify() function from main function get
executes in modifycode.cpp file.
2)In
repalcecall() function:
Input:
Roll_no to modify
3)Read
whole file using ifstream format of file reading and compare our entered data
with existing data in the file using “if” condition.
4)If
compare result ==0,then display student data from records created.
5)
After modifying data, encounter delete _line() function for deleting line space
created by pre-existing data .//because we are using csv(excel) file for
storing student data.
b)for
deleting student info :
1)
Function call “deletecall()”which is
under modify() function from main
function get executes in modifycode.cpp file.
2)In
deletecall() function:
Input:Roll_no
to delete info.
3)Read
file info using ifstream format of file reading reading and compare our entered
data with existing data in the file using “if” condition.
4)If compare result ==0,then invoke
delete_linee() function to delete student data from records created.
5)In
delete_linee() function:
//create
a temporary file to store current data from original file
i)Create a temp.txt file in outstream mode
and add all created records into and the the record which we want to delete will remain
in original file.
ii) Remove original file and rename
temp.txt file as original file .Record of student will get deleted.
C) For student attendance info:
A)In
attendance() function of main code two functions are in it as follows:
i>markattendance() ;
//function definition is in Markattendance file
ii>readattendance();
//function definition is in Readattendance file
/*Attendance functions to write & read the student
attendance.
Storing attendance
code in separate file named Markattendance for writing attendance and
other file Readattendance for reading attendance*/
**There are two functions in markattendance file :
A)For markattendance () function:
1)Int writeattendance():
//declare
int,float,char and string variables to access data.
Input :
Roll_no,date,month,year
Write
date in “Newattend.csv” file we created and close the file.
//storing
sub as per choice in sub variable and calling attendance() function(step ii) to
input attendance as present or absent.
For eg.
Sub=”at” //sub name is a string
attendance(); //go to step ii)
2)For void attendance():
1)for present
:
/*After
calling attendance() function from writeattendance() function,program control
passed to attendance() function to input attendance as present ,bsent,lecture
not scheduled*/
Using
switch case in attendance() function for 1)present 2)absent 3)lecture not
scheduled
1)If
present --->increment print variable and lecture/period by 1 and
fout<<”sub:” “<<”p”<<”,”;
2)for
absent:
If
absent--->increment lecture/period no by 1 and fout<<”sub:”
“<<”NA”<<”,”;
//calculate
attendance using
attendance1
= present/periods;
attendance1
= attendance1*100;
cout<<"Attendance
is :"<<attendance1<<"%\n";
//store
info in ofstream fiut("Newattend.csv",ios::app); and close file
B)For Readattendance() function:
Using
switch case input functions as:
Input int
variable for accessing switch case.
cout<<"1.search
by roll and date\n2.search by date only\n3.search all data by roll no.\n4.View
attendance of Sub\n";
i>for case 1:
cout<<"Enter
roll no: ";
cin>>Nroll;
cout<<"Enter
date in dd-mm-yyyy format\n";
getline(cin>>ws,Ndate);
readbyrolldate(); // program control goes to
function
defination
ii>for case 2:
cout<<"Enter date in
dd-mm-yyyy format\n";
getline(cin>>ws,Ndate);
readbydate();} //program
control goes to function definition
iii>for case 3:
cout<<"Enter date in
dd-mm-yyyy format\n";
getline(cin>>ws,Ndate);
readbydate();} //program control goes to function
definition
//calculating total attendance:
totalattendence =
totalattendence/counttheaverage;
cout<<"And Total Attendance
is: "<<setprecision(4)<<totalattendence<<"%"<<endl;}
iv>For
case 4:
cout<<"1.SE\t2.CO\t3.OOP\t4.AT\n5.OS\t6.CN2\n";
int schoice; cin>>schoice;
switch(schoice) {
case 1: Psub ="SE :P"; Asub
="SE :A"; attendbysub();
//program control goes to function definition
break;
case 2: Psub ="CO :P"; Asub
="CO :A"; attendbysub(); break;
case 3: Psub ="oop :P"; Asub
="oop :A"; attendbysub(); break;
case 4: Psub ="AT :P"; Asub
="AT :A"; attendbysub();break;
case 5: Psub ="OS :P"; Asub
="OS :A";attendbysub(); break;
case 6: Psub ="CN2:P"; Asub
="CN2:A"; attendbysub();break;
}
1)function definition of void
readbyrolldate():
ifstream
disp("Newattend.csv");
//read from our created file and read it till end using disp.peek()
condition
while(disp.peek()!=EOF){
getline(disp>>ws,Droll,','); //input roll no and date we want to search
for
getline(disp>>ws,Ddate,',');
//Comparing
date and roll_no using compare format of c++
if(Nroll.compare(Droll)==0){
if(Ndate.compare(Ddate)==0){
cout<<"Date
: "<<Ddate<<endl;
cout<<"sub P/A\n"<<endl;
cout<<fse<<endl<<fco<<endl<<foop<<endl<<fos<<endl<<fcn<<endl;
cout<<"Attendance
: "<<Dattend<<"%"<<endl<<endl;}}
//Dispalying
info of student if both nested conditions get true
2)function definition of readbydate():
//Reading
file same as in function 1)
Repeat
same steps as function 1) for searchbydate()
but here only for date.
getline(dispday>>ws,Ddate,',');
if(Ndate.compare(Ddate)==0){/
repeat steps inside if function in function
1)}
3)Function definition of void readalldata():
Repeat
steps of 1) function for displaying all data.
Input:roll_no
Repeat
steps of function 1)
4)Function definition for
attendancebysub():
Input:Roll_no,astate=0,
precounter=0,
abcounter = 0;
Open
file ifstream absub("Newattend.csv");
while(absub.peek()!=EOF){
if(Nroll.compare(Droll)==0){
atstate = 1;
if(Psub.compare(fse)==0){precounter
= precounter +1;}
//checking conditions for attendance by sub
and likewise increasing counter variable for counting attendance
if(Asub.compare(fse)==0){abcounter =
abcounter +1;}
if(Psub.compare(fco)==0){precounter =
precounter +1;}
if(Asub.compare(fco)==0){abcounter =
abcounter +1;
if(Psub.compare(foop)==0){precounter =
precounter +1;}
if(Asub.compare(foop)==0){abcounter =
abcounter +1;}
if(Psub.compare(fat)==0){precounter =
precounter +1;}
if(Asub.compare(fat)==0){abcounter =
abcounter +1;}
if(Psub.compare(fos)==0){precounter =
precounter +1;}
if(Asub.compare(fos)==0){abcounter =
abcounter +1;}
if(Psub.compare(fcn)==0){precounter =
precounter +1;}
if(Asub.compare(fcn)==0){abcounter =
abcounter +1; }}
if(atstate == 0){cout<<"Sory No
data Found\n";}
if(atstate == 1){
cout<<"total present was
"<<precounter<<endl;
//printing present and absent count
cout<<"total absent was
"<<abcounter<<endl;
//End
of Readattendance function
D)For student_academicrecord ()function:
1)void academicrecord():
Using
switch case to enter choice as 1)addrecord 2)viewrecord
a)void addrecord():
i)Input: first name,fathers
name,lastname,marks in all subjects out of 100
initialize variable addtotal=0 initially
and after adding marks of each
subject increment it by 1.
Calculate percentage with addtotal variable
value we get after adding all subjects marks.
Store this info in file ofstream
addrec("Academics.csv", ios::app);
b)void viewrecord():
Input: prn-no(enrollment number )
Read file addrec("Academics.csv",
ios::app); and compare our input with the records data using compare function
as we have seen earlier.
if (inprn.compare(prn) == 0)
{
Cout<<”record found”<<endl;
//Display record of student
}
//End of academic record function
academic record : program
good one
ReplyDelete