0% found this document useful (0 votes)
36 views15 pages

Documentation:: Student Database Management System

The document outlines the structure and functions for a student database management system. It describes declaring a structure to store student data including name, ID, department, and other fields. Functions are defined to store entered student data in an array, and search the array by name, department or ID. The main function calls these functions to manage data storage and retrieval.

Uploaded by

Mashal Khalil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views15 pages

Documentation:: Student Database Management System

The document outlines the structure and functions for a student database management system. It describes declaring a structure to store student data including name, ID, department, and other fields. Functions are defined to store entered student data in an array, and search the array by name, department or ID. The main function calls these functions to manage data storage and retrieval.

Uploaded by

Mashal Khalil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

DOCUMENTATION:

S T U D E N T D ATA B A S E
MANAGEMENT SYSTEM
OUTLINES:

Procedure:
Requirements:
Structure:
Use of Array:
Functions:
1. Store all entered data:
2. Search by name:
3. Search by department:
4. Search by id:
5. Main function:
 Loops:
 Do-while:
 Switch:
 If else, nested if-else etc.:

Dry run:
PROCEDURE:
• First of all, analyze the problem, or the requirements of a user.
• Then, Thick about the possible solutions.
• Implement the most effective and efficient solutions.
• After that when we have decided the solutions and copy work of that problem.
• Start coding, During coding, our first priority is to make a structure in which
we will declare all those variables which we are going to use during the whole
program, because they have been declared globally in the Structure.
• Afterwards declare the Functions, which helped us during the program and
work more efficiently and neatly.

• Main body or Main function of a program is the


most important thing
REQUIRMENTS:

 To display student’s data of Air university:


1. Program must take input from user.
2. Program must be able to insert data of a student of different departments
such as CS, CY’s, and AvM etc.
3. Code must be able to search by name like, if user wants to search the
student from any department ,So he just have to enters the student name.
4. Code is able to search data by ID number allotted by University
management.
5. Code is able to search print about the number of students in a certain
department.
6. Program can be print the data of whole department by just entering the
specific department name.
7. It also tells us about the students Fee status that he/she submitted it or
not. Now, is he/she is eligible for sitting in exams.
STRUCTURE:
• Firstly we have to make a #include<iostream>
structure. In which we can using namespace std;
declare all the variables struct student
and their datatypes. That {
we are going to use in the string std_id;
whole program. string std_name;
string std_fathername;
string std_dept;
Declaration of structure, int std_attendance;
whom we name as student char std_feestatus;
string std_activities;
string std_department;
}
Body of the
structure
DECLARATION:
Secondly, declare all the
Function used for
function which can help us searching by ID
during our program.
void searchid(string id);
Main function, in which we can call
all the functions Function used for
To perform there specific tasks searching by department
int main(); void searchbydpt(string dept);

Function used for


Function used for printing all the data searching by name
of Student I,e;name,f_name,id,etc
void searchname(string name);
void stddata(string name, string id,int
attendance, char feestatus, string
fathername, string activity, string dept);
USE OF ARRAY;

• Before going towards the main body, s[20];


and call of functions, First we have
to declare the size of array. int ind=0;
bool spacefull()
• Why are we using array here?
{
• We are using array of name s[size]; if(ind==20)
because we have to save data in that {
array. return true;
• So, this is important to initially gave }
some value to our array. else
{
Here we are using return false;
Which helps us in }
another function:
our whole program. }
It checks the limit of array:
bool spacefull()
FUNCTIONS:

• First, we have to develop


all the functions which can
help us to perform our • Syntax:
tasks more efficiently and 1. void stddata(string name, string
effectively. id,int attendance, char feestatus,
string fathername, string
Following are the function: activity, string dept);
1. Storing all entered data: 2. void searchname(string name);
3. void searchbydpt(string dept);
2. Search by name:
4. void searchid(string id);
3. Search by department: 5. int main();
4. Search by Id:
5. Main body:
1.STORING ALL ENTERED DATA:
void stddata(string name, string id,int attendance, char Function definition
feestatus, string fathername, string activity, string dept)
{
if(spacefull())
{
cout<<"We are sorry!!!You won't do more insertion"; First, it will check the size
} of array, that can we enter
more data into that or not
else
{
s[ind].std_id=id;
s[ind].std_name =name; If condition get false ,which
s[ind].std_attendance=attendance; means the whole space is not
s[ind].std_feestatus=feestatus; covered yet,then it will go
s[ind].std_department=dept; towards the else part.and
s[ind].std_activities=activity; store data in the array.
s[ind].std_fathername=fathername;
ind++; }
} After the entery of data,the index
value of array will be incremented.
2.SEARCH BY NAME:
void searchname(string name) {
if(ind==0) Definition of function:
{
First it will check the name, which you have
cout<<"\nWe are sorry!!!NO NAME IN THE DATABASE\n entered, that either it is in our database or
TRY ANOTHER NAME"<<endl; not
}
else
{
bool flag=true; Condition for comparing the
two names:
for(int i=0;i<ind;i++)
{
1.Which is entered by the user.
2.Which is stored in the
if(s[i].std_name.compare(name)==0)
database.
{
cout<<" STUDENT DATA "<<endl;
cout<<"\nStudent Id | "<<s[i].std_id;
If compiler found the
cout<<"\nStudent Name | "<<s[i].std_name;
same name; it will print
cout<<"\nStudent F Name | "<<s[i].std_fathername;
cout<<"\nStudent Department | "<<s[i].std_department;
all the related data of that
cout<<"\nStudent Attendance | "<<s[i].std_attendance; student which is stored in
cout<<"\nStudent Fee Status | "<<s[i].std_feestatus; that Specific array.
} flag=false;
break;
}
}
3.SEARCH BY DEPARTMENT
void searchbydpt(string dept){
Definition of function:
if(ind==0){
cout<<"We are sorry!!!Enter data "<<endl;} First it will check the condition, either it is in our
else{ database or not

bool flag=true;
cout<<"DATA BASE OF |"<<dept<<"| DEPARTMENT"<<endl;
cout<<"ID"<<"\t"<<"NAME"<<"\t"<<"F Condition for comparing the
NAME"<<"\t"<<"DEPT"<<"\t"<<"ATTND"<<"\t"<<"FEE two departments:
STATUS"<<"\t"<<"C ATIVI"<<endl; 1.Which is entered by the user.
for(int i=0;i<ind;i++){ 2.Which is stored in the
if(s[i].std_department.compare(dept)==0) { database.
cout<<s[i].std_id<<"\t"<<s[i].std_name<<"\t"<<s[i].std_fathername<<"\t"
<<s[i].std_department<<"\t"<<s[i].std_attendance<<"\t"<<s[i].std_feestatu
s<<"\t \t "<<s[i].std_activities<<endl; If compiler found the same
ind++; department, it will print all the data
flag=false; of the department, such as students
name, quantity, f/name etc.
} }
if(flag)
{
cout<<"\n !!ERROR!!";
cout<<"\t\t\t\t-:WE HAVE NO INFO ABOUT THIS If user enters an invalid department
DEPARTMENT:-"<<endl;
Such as default case:
}
}
4.SEARCH BY ID:
void searchid(string id){ Definition of function:
if(ind==0){
cout<<"We are sorry !!"<<endl; First it will check the name, which you have
} entered, that either it is in our database or not
else{
bool flag=true;
for(int i=0;i<ind;i++) Condition for comparing the
{ if(s[i].std_id.compare(id)==0) two ids:
{ 1.Which is entered by the user.
cout<<" STUDENT DATA "<<endl; 2.Which is stored in the
cout<<"\nStudent Id | "<<s[i].std_id; database.
cout<<"\nStudent Name | "<<s[i].std_name;
cout<<"\nStudent F Name | "<<s[i].std_fathername;
cout<<"\nStudent Department | "<<s[i].std_department;
If compiler found the same
cout<<"\nStudent Attendance | "<<s[i].std_attendance; name; it will print all the related
cout<<"\nStudent Fee Status | "<<s[i].std_feestatus; data of that student which is
cout<<"\nStudent Activities | "<<s[i].std_activities; stored in that Specific array.
flag=false;
ind++; break;}
}
if(flag){
cout<<"Invalid id !! Try Again"<<endl;
}
}
Default case:
5.MAIN FUNCTION():
 Main function is the most important function used in C++,This is the main body
of any program.
 In which we can call thousands and unlimited functions of different type and
forms by simply calling them which we have declare and defined before the
main body.
• In this program, I’ve also used many functions.
• I’ve used a do while loop for the whole main body and inside that we used switch
statement and gave choice for multiple cases. i,e
• case 1: For entering data:
Case 2: Searching by name:
Case 3: Searching by department:
Case 4: Searching by ID:
Case 5: For exit program:
 By the help of function call I’ve called the functions according to the cases and choices
which we’ve given before:
BODY OF MAIN FUNCTION( ):
 GROUP MEMBERS:

• KHUZAIMA AYAZ

• TANIA TANVEER

• MASHAL KHALIL

• Muhammad FAIZAN

You might also like