SlideShare a Scribd company logo
1 of 15
ONLINE STUDENT
MANAGEMENT SYSTEM
SUBJECT: ADVANCE DATA STRUCTURES
SUBMITTED TO: MR. MAGETO VICTOR SIR
SUBMITTED BY: PURSHOTTAM VERMA
SID: 57920 (B.tech CSE Vth Sem.)
OVERVIEW
Databases are being used in every aspect of our lives right now. Trillions of bytes of
data are being stored in servers around the world. SQL is one of the most basic
methods to use such a database. But have you ever thought about using C++ to
maintain such a database. In this post, we will talk about implementing different views
on a text file according to the type of user and edit accordingly.
The data stored using this code are:
1) Registration number
2) Name
3) Marks in CSE1001
4) Marks in CSE1002
5) Proctor ID
SOURCE CODE
#include<stdio.h>
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main(){
//Considering the max length of data entered (name) to be 15.
char data[15];
int n = 0, option = 0, count_n = 0;
//This is the initial mark alloted to a subject.
string empty = "00";
string proctor = "";
//Name of the file in which DB is stored.
ifstream f("Example.txt");
string line;
//The following for loop counts the total number of lines in the file.
for (int i = 0; std::getline(f, line); ++i){
count_n++;}
while(option != 6){
//This prints out all the available options in the DB
cout << "nAvailable operations: n1. Add New Studentsn2."
<< "Student Loginn3. Faculty Loginn4. Proctor Loginn5. Admin Viewn"
<< "6. ExitnEnter option: ";
cin >> option;
if(option == 1){
cout << "Enter the number of students: ";
cin >> n;
count_n = count_n + n;
for (int i = 0;i < n;i++){
ofstream outfile;
outfile.open("Example.txt",ios::app);
//The entire data of a single student is stored line-by-line.
cout << "Enter your registration number: ";
cin >> data;
outfile << data << "t";
cout << "Enter your name: ";
cin >> data;
int len = strlen(data);
while (len < 15){
data[len] = ' ';
len = len + 1;
}
outfile << data << "t";
//Inserting empty data initially into the file
outfile << empty << "t";
outfile << empty << "t";
cout << "Enter your proctor ID: ";
cin >> proctor;
outfile << proctor << endl;
}}
else if (option == 2){
char regno[9];
cout << "Enter your registration number: ";
cin >> regno;
ifstream infile;
int check = 0;
infile.open("Example.txt",ios::in);
//This loop prints out the data according to the registration number specified.
while (infile >> data){
if (strcmp(data,regno) == 0){
cout << "nRegistration Number: " << data << endl;
infile >> data;
cout << "Name: " << data << endl;
infile >> data;
cout << "CSE1001 mark: " << data << endl;
infile>>data;
cout<<"CSE1002 mark: "<<data<<endl;
infile>>data;
cout<<"Proctor ID: "<<data<<endl;
infile.close();
check = 1;}
}
if (check == 0){
cout<<"No such registration number found!"<<endl;}
}
//This loop is used to view and add marks to the database of a student.
else if (option == 3){
char subcode[7];
cout << "Enter your subject code: ";
cin >> subcode;
string code1 = "CSE1001", code2 = "CSE1002",mark = "";
ifstream infile;
int check = 0;
cout << "nAvailable operations: n1. Add data about marksn"
<< "2. View datanEnter option: ";
cin >> option;
if (option == 1){
cout << "Warning! You would need to add mark"
<< "details for all the students!" << endl;
for(int i = 0;i < count_n;i++){
fstream file("Example.txt");
//The seek in file has been done according to the length
//of the data being inserted. It needs to adjusted accordingly
//for diffferent lengths of data.
if(strcmp(subcode,code1.c_str()) == 0){
file.seekp(26+37*i,std::ios_base::beg);
cout << "Enter the mark of student#" << (i+1) << " : ";
cin >> mark;
file.write(mark.c_str(),2);}
if(strcmp(subcode,code2.c_str()) == 0){
file.seekp(29+37*i,std::ios_base::beg);
cout << "Enter the mark of student#" << (i+1) << " : ";
cin >> mark;
file.write(mark.c_str(),2);}
}
}
//This loop is used to view marks of a student.
//The extra infile commands have been used to get a specific mark
//only since the data has been seperated by a tabspace.
else if(option == 2){
infile.open("Example.txt",ios::in);
if (strcmp(subcode,code1.c_str()) == 0){
cout << "Registration number - Marksn" << endl;
while(infile >> data){
cout << data;
infile >> data;
infile >> data;
cout << " - " << data << endl;
infile >> data;
infile >> data;
check = 1;
}
}
infile.close();
infile.open("Example.txt",ios::in);
if(strcmp(subcode,code2.c_str()) == 0){
cout << "Registration number - Marksn" << endl;
while(infile >> data){
cout << data;
infile >> data;
infile >> data;
infile >> data;
cout << " - " << data << endl;
infile >> data;
check = 1;
}
}}
infile.close();
if (check == 0){
cout << "No such subject code found!" << endl;
}
}
//This loop displays all the details of students under the same proctor ID.
else if (option == 4){
char procid[7];
cout << "Enter your proctor ID: ";
cin >> procid;
int check = 1;
char temp1[100], temp2[100], temp3[100];
char temp4[100], id[100];
ifstream infile;
infile.open("Example.txt",ios::in);
while (infile >> temp1){
infile >> temp2;
infile >> temp3;
infile >> temp4;
infile >> id;
if (strcmp(id,procid) == 0){
cout << "nRegistration Number: " << temp1 << endl;
cout << "Name: " << temp2 << endl;
cout << "CSE1001 Mark: " << temp3 << endl;
cout << "CSE1002 Mark: " << temp4 << endl;
check = 1;
}
}
if (check == 0){
cout << "No such proctor ID found!" << endl;
}}
//This loop acts as an admin view to see all the data in the file.
else if(option == 5){
char password[25];
cout << "Enter the admin password: ";
cin >> password;
//This variable value can be changed according to your requirement
//of the administrator password.
string admin_pass = "admin";
if (strcmp(password,admin_pass.c_str()) == 0){
cout << "Reg No. tNametCSE1001tCSE1002tProctor ID" << endl;
ifstream infile;
infile.open("Example.txt",ios::in);
char data[20];
while(infile >> data){
cout << data << "t";
infile >> data;
cout << data << "t";
infile >> data;
cout << data << "t";
infile >> data;
cout << data << "t";
infile >> data;
cout << data << endl;
}
}
}
}}
THANK YOU

More Related Content

What's hot

Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacionJeff Tu Pechito
 
Computer science project work
Computer science project workComputer science project work
Computer science project workrahulchamp2345
 
JVM code reading -- C2
JVM code reading -- C2JVM code reading -- C2
JVM code reading -- C2ytoshima
 
JavaScript Proxy (ES6)
JavaScript Proxy (ES6)JavaScript Proxy (ES6)
JavaScript Proxy (ES6)Aries Cs
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THSHAJUS5
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in cgkgaur1987
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd marchRajeev Sharan
 
RAILWAY RESERWATION PROJECT PROGRAM
RAILWAY RESERWATION PROJECT PROGRAMRAILWAY RESERWATION PROJECT PROGRAM
RAILWAY RESERWATION PROJECT PROGRAMKrishna Raj
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++Bharat Kalia
 
DConf 2016 std.database (a proposed interface & implementation)
DConf 2016 std.database (a proposed interface & implementation)DConf 2016 std.database (a proposed interface & implementation)
DConf 2016 std.database (a proposed interface & implementation)cruisercoder
 
[2007 CodeEngn Conference 01] seaofglass - Linux Virus Analysis
[2007 CodeEngn Conference 01] seaofglass - Linux Virus Analysis[2007 CodeEngn Conference 01] seaofglass - Linux Virus Analysis
[2007 CodeEngn Conference 01] seaofglass - Linux Virus AnalysisGangSeok Lee
 
Understanding storage class using nm
Understanding storage class using nmUnderstanding storage class using nm
Understanding storage class using nmmohamed sikander
 
Institute management
Institute managementInstitute management
Institute managementvarun arora
 

What's hot (20)

C programs
C programsC programs
C programs
 
C++ file
C++ fileC++ file
C++ file
 
Ejercicios de programacion
Ejercicios de programacionEjercicios de programacion
Ejercicios de programacion
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
 
JVM code reading -- C2
JVM code reading -- C2JVM code reading -- C2
JVM code reading -- C2
 
P5
P5P5
P5
 
Opp compile
Opp compileOpp compile
Opp compile
 
JavaScript Proxy (ES6)
JavaScript Proxy (ES6)JavaScript Proxy (ES6)
JavaScript Proxy (ES6)
 
C program
C programC program
C program
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in c
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 
Ccc
CccCcc
Ccc
 
RAILWAY RESERWATION PROJECT PROGRAM
RAILWAY RESERWATION PROJECT PROGRAMRAILWAY RESERWATION PROJECT PROGRAM
RAILWAY RESERWATION PROJECT PROGRAM
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
DConf 2016 std.database (a proposed interface & implementation)
DConf 2016 std.database (a proposed interface & implementation)DConf 2016 std.database (a proposed interface & implementation)
DConf 2016 std.database (a proposed interface & implementation)
 
[2007 CodeEngn Conference 01] seaofglass - Linux Virus Analysis
[2007 CodeEngn Conference 01] seaofglass - Linux Virus Analysis[2007 CodeEngn Conference 01] seaofglass - Linux Virus Analysis
[2007 CodeEngn Conference 01] seaofglass - Linux Virus Analysis
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
Understanding storage class using nm
Understanding storage class using nmUnderstanding storage class using nm
Understanding storage class using nm
 
Institute management
Institute managementInstitute management
Institute management
 

Similar to ONLINE STUDENT MANAGEMENT SYSTEM

Sample file processing
Sample file processingSample file processing
Sample file processingIssay Meii
 
Exmaples of file handling
Exmaples of file handlingExmaples of file handling
Exmaples of file handlingsparkishpearl
 
file handling final3333.pptx
file handling final3333.pptxfile handling final3333.pptx
file handling final3333.pptxradhushri
 
Chpater29 operation-on-file
Chpater29 operation-on-fileChpater29 operation-on-file
Chpater29 operation-on-fileDeepak Singh
 
A miało być tak... bez wycieków
A miało być tak... bez wyciekówA miało być tak... bez wycieków
A miało być tak... bez wyciekówKonrad Kokosa
 
Nitin Mishra 0301EC201039 Internship PPT.pptx
Nitin Mishra 0301EC201039 Internship PPT.pptxNitin Mishra 0301EC201039 Internship PPT.pptx
Nitin Mishra 0301EC201039 Internship PPT.pptxshivam460694
 
Sense And Simplicity Info Path Task Forms Made Easy
Sense And Simplicity   Info Path Task Forms Made EasySense And Simplicity   Info Path Task Forms Made Easy
Sense And Simplicity Info Path Task Forms Made EasyFlorin Muntean
 
Railway reservation
Railway reservationRailway reservation
Railway reservationSwarup Boro
 
PCI Security Requirements - secure coding
PCI Security Requirements - secure codingPCI Security Requirements - secure coding
PCI Security Requirements - secure codingHaitham Raik
 
Gaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third YearGaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third Yeardezyneecole
 
Secure erasure code based cloud storage system with secure data forwarding
Secure erasure code based cloud storage system with secure data forwardingSecure erasure code based cloud storage system with secure data forwarding
Secure erasure code based cloud storage system with secure data forwardingPriyank Rupera
 
Hack an ASP .NET website? Hard, but possible!
Hack an ASP .NET website? Hard, but possible! Hack an ASP .NET website? Hard, but possible!
Hack an ASP .NET website? Hard, but possible! Vladimir Kochetkov
 

Similar to ONLINE STUDENT MANAGEMENT SYSTEM (20)

Sample file processing
Sample file processingSample file processing
Sample file processing
 
Exmaples of file handling
Exmaples of file handlingExmaples of file handling
Exmaples of file handling
 
file handling final3333.pptx
file handling final3333.pptxfile handling final3333.pptx
file handling final3333.pptx
 
File Organization & processing Mid term summer 2014 - modelanswer
File Organization & processing Mid term summer 2014 - modelanswerFile Organization & processing Mid term summer 2014 - modelanswer
File Organization & processing Mid term summer 2014 - modelanswer
 
Chpater29 operation-on-file
Chpater29 operation-on-fileChpater29 operation-on-file
Chpater29 operation-on-file
 
CGI.ppt
CGI.pptCGI.ppt
CGI.ppt
 
A miało być tak... bez wycieków
A miało być tak... bez wyciekówA miało być tak... bez wycieków
A miało być tak... bez wycieków
 
CSNB244 Lab5
CSNB244 Lab5CSNB244 Lab5
CSNB244 Lab5
 
Nitin Mishra 0301EC201039 Internship PPT.pptx
Nitin Mishra 0301EC201039 Internship PPT.pptxNitin Mishra 0301EC201039 Internship PPT.pptx
Nitin Mishra 0301EC201039 Internship PPT.pptx
 
Sense And Simplicity Info Path Task Forms Made Easy
Sense And Simplicity   Info Path Task Forms Made EasySense And Simplicity   Info Path Task Forms Made Easy
Sense And Simplicity Info Path Task Forms Made Easy
 
Railway reservation
Railway reservationRailway reservation
Railway reservation
 
PCI Security Requirements - secure coding
PCI Security Requirements - secure codingPCI Security Requirements - secure coding
PCI Security Requirements - secure coding
 
Gaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third YearGaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third Year
 
Secure erasure code based cloud storage system with secure data forwarding
Secure erasure code based cloud storage system with secure data forwardingSecure erasure code based cloud storage system with secure data forwarding
Secure erasure code based cloud storage system with secure data forwarding
 
Hack an ASP .NET website? Hard, but possible!
Hack an ASP .NET website? Hard, but possible! Hack an ASP .NET website? Hard, but possible!
Hack an ASP .NET website? Hard, but possible!
 
Taint scope
Taint scopeTaint scope
Taint scope
 
Hospital management
Hospital managementHospital management
Hospital management
 
Hospital management
Hospital managementHospital management
Hospital management
 
C++ files and streams
C++ files and streamsC++ files and streams
C++ files and streams
 
Database security
Database securityDatabase security
Database security
 

More from Rohit malav

Aca lab project (rohit malav)
Aca lab project (rohit malav) Aca lab project (rohit malav)
Aca lab project (rohit malav) Rohit malav
 
operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)Rohit malav
 
Python pandas liberary
Python pandas liberaryPython pandas liberary
Python pandas liberaryRohit malav
 
Presentation by purshotam verma
Presentation by purshotam vermaPresentation by purshotam verma
Presentation by purshotam vermaRohit malav
 
Deep learning in python by purshottam verma
Deep learning in python by purshottam vermaDeep learning in python by purshottam verma
Deep learning in python by purshottam vermaRohit malav
 
Atm Security System Using Steganography Nss ptt by (rohit malav)
Atm Security System Using  Steganography Nss ptt by (rohit malav)Atm Security System Using  Steganography Nss ptt by (rohit malav)
Atm Security System Using Steganography Nss ptt by (rohit malav)Rohit malav
 
Samba server Pts report pdf by Rohit malav
Samba server Pts report pdf by Rohit malavSamba server Pts report pdf by Rohit malav
Samba server Pts report pdf by Rohit malavRohit malav
 
System calls operating system ppt by rohit malav
System calls operating system  ppt by rohit malavSystem calls operating system  ppt by rohit malav
System calls operating system ppt by rohit malavRohit malav
 
A project on spring framework by rohit malav
A project on spring framework by rohit malavA project on spring framework by rohit malav
A project on spring framework by rohit malavRohit malav
 
android text encryption Network security lab by rohit malav
android text encryption Network security lab by rohit malavandroid text encryption Network security lab by rohit malav
android text encryption Network security lab by rohit malavRohit malav
 
samba server setup Pts ppt (rohit malav)
samba server setup Pts ppt (rohit malav)samba server setup Pts ppt (rohit malav)
samba server setup Pts ppt (rohit malav)Rohit malav
 
Spring frame work by rohit malav(detailed)
Spring frame work by rohit malav(detailed)Spring frame work by rohit malav(detailed)
Spring frame work by rohit malav(detailed)Rohit malav
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malavspring framework ppt by Rohit malav
spring framework ppt by Rohit malavRohit malav
 
Samba server linux (SMB) BY ROHIT MALAV
Samba server linux (SMB) BY ROHIT MALAVSamba server linux (SMB) BY ROHIT MALAV
Samba server linux (SMB) BY ROHIT MALAVRohit malav
 
Payroll system ppt1 (rohit malav)
Payroll system ppt1 (rohit malav)Payroll system ppt1 (rohit malav)
Payroll system ppt1 (rohit malav)Rohit malav
 
Payroll system ppt2 (rohit malav) version point 2
Payroll system ppt2 (rohit malav) version point 2Payroll system ppt2 (rohit malav) version point 2
Payroll system ppt2 (rohit malav) version point 2Rohit malav
 
digital unlock power point slide
digital unlock power point slidedigital unlock power point slide
digital unlock power point slideRohit malav
 
Rohit android lab projects in suresh gyan vihar
Rohit android lab projects in suresh gyan viharRohit android lab projects in suresh gyan vihar
Rohit android lab projects in suresh gyan viharRohit malav
 
Snake report ROHIT MALAV
Snake report ROHIT MALAVSnake report ROHIT MALAV
Snake report ROHIT MALAVRohit malav
 

More from Rohit malav (20)

Aca lab project (rohit malav)
Aca lab project (rohit malav) Aca lab project (rohit malav)
Aca lab project (rohit malav)
 
operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)
 
Python pandas liberary
Python pandas liberaryPython pandas liberary
Python pandas liberary
 
Presentation by purshotam verma
Presentation by purshotam vermaPresentation by purshotam verma
Presentation by purshotam verma
 
Deep learning in python by purshottam verma
Deep learning in python by purshottam vermaDeep learning in python by purshottam verma
Deep learning in python by purshottam verma
 
Atm Security System Using Steganography Nss ptt by (rohit malav)
Atm Security System Using  Steganography Nss ptt by (rohit malav)Atm Security System Using  Steganography Nss ptt by (rohit malav)
Atm Security System Using Steganography Nss ptt by (rohit malav)
 
Samba server Pts report pdf by Rohit malav
Samba server Pts report pdf by Rohit malavSamba server Pts report pdf by Rohit malav
Samba server Pts report pdf by Rohit malav
 
System calls operating system ppt by rohit malav
System calls operating system  ppt by rohit malavSystem calls operating system  ppt by rohit malav
System calls operating system ppt by rohit malav
 
A project on spring framework by rohit malav
A project on spring framework by rohit malavA project on spring framework by rohit malav
A project on spring framework by rohit malav
 
android text encryption Network security lab by rohit malav
android text encryption Network security lab by rohit malavandroid text encryption Network security lab by rohit malav
android text encryption Network security lab by rohit malav
 
samba server setup Pts ppt (rohit malav)
samba server setup Pts ppt (rohit malav)samba server setup Pts ppt (rohit malav)
samba server setup Pts ppt (rohit malav)
 
Spring frame work by rohit malav(detailed)
Spring frame work by rohit malav(detailed)Spring frame work by rohit malav(detailed)
Spring frame work by rohit malav(detailed)
 
spring framework ppt by Rohit malav
spring framework ppt by Rohit malavspring framework ppt by Rohit malav
spring framework ppt by Rohit malav
 
Samba server linux (SMB) BY ROHIT MALAV
Samba server linux (SMB) BY ROHIT MALAVSamba server linux (SMB) BY ROHIT MALAV
Samba server linux (SMB) BY ROHIT MALAV
 
Payroll system ppt1 (rohit malav)
Payroll system ppt1 (rohit malav)Payroll system ppt1 (rohit malav)
Payroll system ppt1 (rohit malav)
 
Payroll system ppt2 (rohit malav) version point 2
Payroll system ppt2 (rohit malav) version point 2Payroll system ppt2 (rohit malav) version point 2
Payroll system ppt2 (rohit malav) version point 2
 
digital unlock power point slide
digital unlock power point slidedigital unlock power point slide
digital unlock power point slide
 
Rohit android lab projects in suresh gyan vihar
Rohit android lab projects in suresh gyan viharRohit android lab projects in suresh gyan vihar
Rohit android lab projects in suresh gyan vihar
 
Snake report ROHIT MALAV
Snake report ROHIT MALAVSnake report ROHIT MALAV
Snake report ROHIT MALAV
 
Gyan vihar app
Gyan vihar appGyan vihar app
Gyan vihar app
 

Recently uploaded

Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 

Recently uploaded (20)

Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 

ONLINE STUDENT MANAGEMENT SYSTEM

  • 1. ONLINE STUDENT MANAGEMENT SYSTEM SUBJECT: ADVANCE DATA STRUCTURES SUBMITTED TO: MR. MAGETO VICTOR SIR SUBMITTED BY: PURSHOTTAM VERMA SID: 57920 (B.tech CSE Vth Sem.)
  • 2. OVERVIEW Databases are being used in every aspect of our lives right now. Trillions of bytes of data are being stored in servers around the world. SQL is one of the most basic methods to use such a database. But have you ever thought about using C++ to maintain such a database. In this post, we will talk about implementing different views on a text file according to the type of user and edit accordingly. The data stored using this code are: 1) Registration number 2) Name 3) Marks in CSE1001 4) Marks in CSE1002 5) Proctor ID
  • 3. SOURCE CODE #include<stdio.h> #include<iostream> #include<fstream> #include<string.h> using namespace std; int main(){ //Considering the max length of data entered (name) to be 15. char data[15]; int n = 0, option = 0, count_n = 0; //This is the initial mark alloted to a subject. string empty = "00"; string proctor = ""; //Name of the file in which DB is stored. ifstream f("Example.txt"); string line;
  • 4. //The following for loop counts the total number of lines in the file. for (int i = 0; std::getline(f, line); ++i){ count_n++;} while(option != 6){ //This prints out all the available options in the DB cout << "nAvailable operations: n1. Add New Studentsn2." << "Student Loginn3. Faculty Loginn4. Proctor Loginn5. Admin Viewn" << "6. ExitnEnter option: "; cin >> option; if(option == 1){ cout << "Enter the number of students: "; cin >> n; count_n = count_n + n; for (int i = 0;i < n;i++){ ofstream outfile; outfile.open("Example.txt",ios::app);
  • 5. //The entire data of a single student is stored line-by-line. cout << "Enter your registration number: "; cin >> data; outfile << data << "t"; cout << "Enter your name: "; cin >> data; int len = strlen(data); while (len < 15){ data[len] = ' '; len = len + 1; } outfile << data << "t"; //Inserting empty data initially into the file outfile << empty << "t"; outfile << empty << "t"; cout << "Enter your proctor ID: "; cin >> proctor; outfile << proctor << endl; }}
  • 6. else if (option == 2){ char regno[9]; cout << "Enter your registration number: "; cin >> regno; ifstream infile; int check = 0; infile.open("Example.txt",ios::in); //This loop prints out the data according to the registration number specified. while (infile >> data){ if (strcmp(data,regno) == 0){ cout << "nRegistration Number: " << data << endl; infile >> data; cout << "Name: " << data << endl; infile >> data; cout << "CSE1001 mark: " << data << endl; infile>>data; cout<<"CSE1002 mark: "<<data<<endl;
  • 7. infile>>data; cout<<"Proctor ID: "<<data<<endl; infile.close(); check = 1;} } if (check == 0){ cout<<"No such registration number found!"<<endl;} } //This loop is used to view and add marks to the database of a student. else if (option == 3){ char subcode[7]; cout << "Enter your subject code: "; cin >> subcode; string code1 = "CSE1001", code2 = "CSE1002",mark = ""; ifstream infile; int check = 0;
  • 8. cout << "nAvailable operations: n1. Add data about marksn" << "2. View datanEnter option: "; cin >> option; if (option == 1){ cout << "Warning! You would need to add mark" << "details for all the students!" << endl; for(int i = 0;i < count_n;i++){ fstream file("Example.txt"); //The seek in file has been done according to the length //of the data being inserted. It needs to adjusted accordingly //for diffferent lengths of data. if(strcmp(subcode,code1.c_str()) == 0){ file.seekp(26+37*i,std::ios_base::beg); cout << "Enter the mark of student#" << (i+1) << " : "; cin >> mark; file.write(mark.c_str(),2);}
  • 9. if(strcmp(subcode,code2.c_str()) == 0){ file.seekp(29+37*i,std::ios_base::beg); cout << "Enter the mark of student#" << (i+1) << " : "; cin >> mark; file.write(mark.c_str(),2);} } } //This loop is used to view marks of a student. //The extra infile commands have been used to get a specific mark //only since the data has been seperated by a tabspace. else if(option == 2){ infile.open("Example.txt",ios::in); if (strcmp(subcode,code1.c_str()) == 0){ cout << "Registration number - Marksn" << endl; while(infile >> data){ cout << data; infile >> data; infile >> data;
  • 10. cout << " - " << data << endl; infile >> data; infile >> data; check = 1; } } infile.close(); infile.open("Example.txt",ios::in); if(strcmp(subcode,code2.c_str()) == 0){ cout << "Registration number - Marksn" << endl; while(infile >> data){ cout << data; infile >> data; infile >> data; infile >> data; cout << " - " << data << endl;
  • 11. infile >> data; check = 1; } }} infile.close(); if (check == 0){ cout << "No such subject code found!" << endl; } } //This loop displays all the details of students under the same proctor ID. else if (option == 4){ char procid[7]; cout << "Enter your proctor ID: "; cin >> procid;
  • 12. int check = 1; char temp1[100], temp2[100], temp3[100]; char temp4[100], id[100]; ifstream infile; infile.open("Example.txt",ios::in); while (infile >> temp1){ infile >> temp2; infile >> temp3; infile >> temp4; infile >> id; if (strcmp(id,procid) == 0){ cout << "nRegistration Number: " << temp1 << endl; cout << "Name: " << temp2 << endl; cout << "CSE1001 Mark: " << temp3 << endl; cout << "CSE1002 Mark: " << temp4 << endl; check = 1; } }
  • 13. if (check == 0){ cout << "No such proctor ID found!" << endl; }} //This loop acts as an admin view to see all the data in the file. else if(option == 5){ char password[25]; cout << "Enter the admin password: "; cin >> password; //This variable value can be changed according to your requirement //of the administrator password. string admin_pass = "admin"; if (strcmp(password,admin_pass.c_str()) == 0){ cout << "Reg No. tNametCSE1001tCSE1002tProctor ID" << endl; ifstream infile;
  • 14. infile.open("Example.txt",ios::in); char data[20]; while(infile >> data){ cout << data << "t"; infile >> data; cout << data << "t"; infile >> data; cout << data << "t"; infile >> data; cout << data << "t"; infile >> data; cout << data << endl; } } } }}