SlideShare a Scribd company logo
Comsats Institute Of Information And Technology Islamabad Chak Shahzad

Haq Nawaz CH
Sp12-BCS-089
Student Data Base program C/C++
Output :
C/C++ CODE
#include<iostream>
#include<conio.h>
#include<cstring>
#include<ctype.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
void show1();
void pass();
void menu();
void entrec();
void modpass();
void modrec();
void mdf();
void show();
void upd_rec();
void srch();
void exit();
void hid();
void del();
int t=0;
struct name { char first_name[20];
char last_name[20];
};
struct pass
{ char name[20];
char pass[20];
}user;
struct bio_data
{
name ful_name;
char add[100];
int age;
int phon_num;
char gender[10];
};
bio_data p[10];
int i=0;
int main()
{
char hid[11];
for (int t=0;t<10;t++)
hid[t]=0;
strcpy(user.name,"ABC");
strcpy(user.pass,"ABC");
pass();
getch();
}
void pass() //defination of password
{ system("cls");
char name[20];
char password[20];
cout<<"Enter user name"<<"t:";
cin>>name;
cout<<"Enter password"<<"t:";
cin>>password;
int c,c1;
int i=0;
char pw;
c=strcmp(name,user.name);
c1=strcmp(password,user.pass);
if(c==0&&c1==0)
{

}
else

system("cls");
cout<<"welcome menue"<<endl;
menu();
getch();

if(c!=0||c1!=0)
{ system("cls");
cout<<"login not match try again";
}
getch();
pass();
// cout<<"modify passw";
}
void menu()
{ system("cls");
cout<<"ttt______________________________"<<endl;
cout<<"ttttwelcome to Menu"<<endl;
cout<<"tttt1:Enter Record"<<endl;
cout<<"tttt2:Show Record"<<endl;
cout<<"tttt3:Modify Record"<<endl;
cout<<"tttt4:Hide Record"<<endl;
cout<<"tttt5:Delete Record"<<endl;
cout<<"tttt6:Modify Password"<<endl;
cout<<"tttt7:Search Record"<<endl;
cout<<"tttt8:Exit Menu"<<endl;
cout<<"ttt______________________________"<<endl;
int choice;
cout<<"Enter your choice:t";
cin>>choice;
switch(choice)
{
case 1:
entrec();
break;
case 2:

show();
break;

case 3:

mdf();
break;

case 4:

hid();
break;

case 5:
case 6:

srch();

del();

break;
modpass();

break;

case 7:

break;

case 8:
exit();
}
menu();

break;
}
void modpass()
{ system("cls");
cout<<"ttEnter new password"<<endl;
char pw;
int i=0;
cin>>user.pass;
system("cls");
cout<<"ttPassword Cahnged"<<endl;
cout<<"ttPress Enter to Continue"<<endl;
pass();
getch();
}
void entrec()
{ system("cls");
cout<<"enter number of record you want to add"<<endl;
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"_______________"<<endl;
cout<<"enter 1st name :t";
cin>>p[i].ful_name.first_name;
cout<<"enter last name:t";
cin>>p[i].ful_name.last_name;
cout<<"address
:t";
cin>>p[i].add;
cout<<"age
:t";
cin>>p[i].age;
cout<<"phon
:t";
cin>>p[i].phon_num;
cout<<"gender
:t";
cin>>p[i].gender;
getch();
}
}
void del()
{ system("cls");
cout<<"enter required out put numbert"<<endl;
int n,a;
cin>>n;
a=0;
char lname[20];
cout<<"enter last name to del record"<<endl;
cin>>lname;
for(int i=1;i<=n;i++){
if(strcmp(p[i].ful_name.last_name,lname)==0)
{
cout<<"t----------------------------------"<<endl;
cout<<"tfirst name:t"<<p[i].ful_name.first_name=='0';
cout<<"tlast name :t"<<(p[i].ful_name.last_name)=='0';
cout<<"taddress :t"<<p[i].add=='0';
cout<<"tphone# :t"<<p[i].phon_num=='0';
cout<<"tage
:t"<<p[i].age=='0';
cout<<"tgender :t"<<p[i].gender=='0';
cout<<"t----------------------------------"<<endl;
}a++;
cout<<"showing records:"<<a<<endl;
getch();
}
}
void mdf()
{
system("cls");
int n;
char lname[20];
cout<<"enter last name"<<endl;
cin>>lname;
//cout<<"search upto ....num?"<<endl;
//cin>>n;
for(int i=1;i<=9;i++)
{
if(strcmp(p[i].ful_name.last_name,lname)==0)
{
cout<<"enter 1st name:t";
cin>>p[i].ful_name.first_name;
cout<<"enter last name:t";
cin>>p[i].ful_name.last_name;
cout<<"address:t";
cin>>p[i].add;
cout<<"age:t";
cin>>p[i].age;
cout<<"phon:t";
cin>>p[i].phon_num;
cout<<"gender:t";
cin>>p[i].gender;
}
//getch();
} getch();
menu();
}
void show1()
{ system("cls");
for(int i=1;i<=5;i++)
{
cout<<"t----------------------------------"<<endl;
cout<<"tfirst name:tt"<<p[i].ful_name.first_name<<endl;
cout<<"tlast name :tt"<<p[i].ful_name.first_name<<endl;
cout<<"taddress :tt"<<p[i].add<<endl;
cout<<"tage
:tt"<<p[i].phon_num<<endl;
cout<<"tgendr :tt"<<p[i].age<<endl;
cout<<"tphon num :tt"<<p[i].gender<<endl;
cout<<"t----------------------------------"<<endl;
} //break;
getch();
}
void exit()
{
exit(0);
}
void hid()
{
char hide[t];
for (int t=0;t<10;t++)
hide[t]=0;
char nme[20];
char h;
h=0;
cout<<"Please Enter last name to hide:";
cin>>nme;
for (int i=0;i<9;i++)
{

if (strcmp(p[i].ful_name.last_name,nme)==0)
{
hide[i]=1;
}
h=1;

}
cout<<"Hidden Successful"<<endl;
if (h==0)
cout<<"Record not Available"<<endl;
getch();
menu();
}

void srch()
{
system("cls");
char hide[10];
for (int t=0;t<10;t++)
hide[t]=0;
char nm[20];
char a;
a=0;
cout<<"nEnter Patient Last Name:";
cin>>nm;
for (int i=0;i<9;i++)
{
if (strcmp(p[i].ful_name.last_name,nm)==0 && hide[i]==0)
{
cout<<"tt------------------------";
cout<<"ntt1 Record match!!!n";
cout<<"nttFirst Name
:";
cout<<p[i].ful_name.first_name;
cout<<"nttPatient Last Name :";
cout<<p[i].ful_name.last_name;
cout<<"nttPatient Phone number:";
cout<<p[i].phon_num;
cout<<"nttPatient Age
:";
cout<<p[i].age;
cout<<"nttPatient gender :";
cout<<p[i].gender<<endl;
cout<<"tt------------------------n";
cout<<"nnn";
a=1;
}
}

getch();
menu();}

if (a==0)
cout<<"nRecord not availablen";

void show()
{
system("cls");
char hide[10];
for (int t=0;t<10;t++)
hide[t]=0;
for (int i=0;i<9;i++)
{
if (hide[i]==0&& strlen(p[i].ful_name.last_name)>0)
{
cout<<"nRecord number t :"<<i+1;
cout<<"nPatient First Namet :";
cout<<p[i].ful_name.first_name;
cout<<"nPatient Last Namet :";
cout<<p[i].ful_name.last_name;
cout<<"nPatient Phone numbert:";
cout<<p[i].phon_num;
cout<<"nPatient Address t:";
cout<<p[i].add;
cout<<"nPatient Age
t:";
cout<<p[i].age;
cout<<"nPatient gender t:";
cout<<p[i].gender;
cout<<endl;
}
}getch();
}
/*void del()
{ system("cls");
char name[22];
cout<<"enter 1st name to dell"<<endl;
cin>>name;
int a,b;
for(int i=0;i<=9;i++)
{
a=strcmp(name,p[i].ful_name.first_name);
if(a==0)
{
cout<<p[i].ful_name.first_name=='0';
cout<<p[i].ful_name.last_name=='0';
cout<<p[i].add=='0';
cout<<p[i].phon_num=='0';
cout<<p[i].age=='0';
cout<<p[i].gender=='0';
}
}
cout<<"record deleted"<<endl;
getch();
}
*/

More Related Content

What's hot

Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Rushil Aggarwal
 
systems programming lab programs in c
systems programming lab programs in csystems programming lab programs in c
systems programming lab programs in cMeghna Roy
 
Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12
Raunak Yadav
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
SHAJUS5
 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using csnsanth
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservationSwarup Kumar Boro
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
Bharat Kalia
 
Introduzione a C#
Introduzione a C#Introduzione a C#
Introduzione a C#
Lorenz Cuno Klopfenstein
 
System programs in C language.
System programs in C language.System programs in C language.
System programs in C language.
Sudhakar Srivastava
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical file
Ankit Dixit
 
C programs
C programsC programs
C programs
Vikram Nandini
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
Chris Ohk
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd marchRajeev Sharan
 
Railwaynew
RailwaynewRailwaynew
Railwaynew
Arsh Vishwakarma
 
Assignment no39
Assignment no39Assignment no39
Assignment no39Jay Patel
 
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
अयशकांत मिश्र
 
Declaring friend function with inline code
Declaring friend function with inline codeDeclaring friend function with inline code
Declaring friend function with inline codeRajeev Sharan
 

What's hot (20)

C++ programs
C++ programsC++ programs
C++ programs
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
 
systems programming lab programs in c
systems programming lab programs in csystems programming lab programs in c
systems programming lab programs in c
 
Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using c
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
Supermarket
SupermarketSupermarket
Supermarket
 
Introduzione a C#
Introduzione a C#Introduzione a C#
Introduzione a C#
 
System programs in C language.
System programs in C language.System programs in C language.
System programs in C language.
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical file
 
C programs
C programsC programs
C programs
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 
Opp compile
Opp compileOpp compile
Opp compile
 
Railwaynew
RailwaynewRailwaynew
Railwaynew
 
Assignment no39
Assignment no39Assignment no39
Assignment no39
 
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
 
Declaring friend function with inline code
Declaring friend function with inline codeDeclaring friend function with inline code
Declaring friend function with inline code
 

Similar to Student Data Base Using C/C++ Final Project

P5
P5P5
Railway reservation
Railway reservationRailway reservation
Railway reservation
Swarup Boro
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! aleks-f
 
Cd practical file (1) start se
Cd practical file (1) start seCd practical file (1) start se
Cd practical file (1) start se
dalipkumar64
 
Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)
Jaydip JK
 
Gaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third YearGaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third Year
dezyneecole
 
C programming structure & pointer
C  programming structure & pointerC  programming structure & pointer
C programming structure & pointer
argusacademy
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
Syed Umair
 
Ccc
CccCcc
pattern-printing-in-c.pdf
pattern-printing-in-c.pdfpattern-printing-in-c.pdf
pattern-printing-in-c.pdf
RSathyaPriyaCSEKIOT
 
C basics
C basicsC basics
C basicsMSc CST
 
C++ programming structure & union
C++ programming structure & unionC++ programming structure & union
C++ programming structure & union
argusacademy
 
RAILWAY RESERWATION PROJECT PROGRAM
RAILWAY RESERWATION PROJECT PROGRAMRAILWAY RESERWATION PROJECT PROGRAM
RAILWAY RESERWATION PROJECT PROGRAM
Krishna Raj
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
Syed Umair
 
C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data typeC program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
loyola ICAM college of engineering and technology
 
C programms
C programmsC programms
C programms
Mukund Gandrakota
 
Bca 1st year C langauge .pdf
Bca 1st year C langauge .pdfBca 1st year C langauge .pdf
Bca 1st year C langauge .pdf
Rahul Saini
 

Similar to Student Data Base Using C/C++ Final Project (20)

C program
C programC program
C program
 
P5
P5P5
P5
 
Railway reservation
Railway reservationRailway reservation
Railway reservation
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
 
Cd practical file (1) start se
Cd practical file (1) start seCd practical file (1) start se
Cd practical file (1) start se
 
Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)Pattern printing-in-c(Jaydip Kikani)
Pattern printing-in-c(Jaydip Kikani)
 
Gaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third YearGaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third Year
 
C programming structure & pointer
C  programming structure & pointerC  programming structure & pointer
C programming structure & pointer
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
 
Ccc
CccCcc
Ccc
 
pattern-printing-in-c.pdf
pattern-printing-in-c.pdfpattern-printing-in-c.pdf
pattern-printing-in-c.pdf
 
C basics
C basicsC basics
C basics
 
C++ programming structure & union
C++ programming structure & unionC++ programming structure & union
C++ programming structure & union
 
RAILWAY RESERWATION PROJECT PROGRAM
RAILWAY RESERWATION PROJECT PROGRAMRAILWAY RESERWATION PROJECT PROGRAM
RAILWAY RESERWATION PROJECT PROGRAM
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
 
C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data typeC program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
 
Data struture lab
Data struture labData struture lab
Data struture lab
 
C programms
C programmsC programms
C programms
 
Ss
SsSs
Ss
 
Bca 1st year C langauge .pdf
Bca 1st year C langauge .pdfBca 1st year C langauge .pdf
Bca 1st year C langauge .pdf
 

Recently uploaded

Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 

Recently uploaded (20)

Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 

Student Data Base Using C/C++ Final Project

  • 1. Comsats Institute Of Information And Technology Islamabad Chak Shahzad Haq Nawaz CH Sp12-BCS-089
  • 2. Student Data Base program C/C++ Output :
  • 3. C/C++ CODE #include<iostream> #include<conio.h> #include<cstring> #include<ctype.h> #include<stdlib.h> #include<stdio.h> using namespace std; void show1(); void pass(); void menu(); void entrec(); void modpass(); void modrec(); void mdf(); void show(); void upd_rec(); void srch(); void exit(); void hid(); void del(); int t=0; struct name { char first_name[20]; char last_name[20]; }; struct pass { char name[20]; char pass[20]; }user; struct bio_data { name ful_name; char add[100]; int age; int phon_num; char gender[10]; }; bio_data p[10]; int i=0;
  • 4. int main() { char hid[11]; for (int t=0;t<10;t++) hid[t]=0; strcpy(user.name,"ABC"); strcpy(user.pass,"ABC"); pass(); getch(); } void pass() //defination of password { system("cls"); char name[20]; char password[20]; cout<<"Enter user name"<<"t:"; cin>>name; cout<<"Enter password"<<"t:"; cin>>password; int c,c1; int i=0; char pw; c=strcmp(name,user.name); c1=strcmp(password,user.pass); if(c==0&&c1==0) { } else system("cls"); cout<<"welcome menue"<<endl; menu(); getch(); if(c!=0||c1!=0) { system("cls"); cout<<"login not match try again"; } getch(); pass(); // cout<<"modify passw"; }
  • 5. void menu() { system("cls"); cout<<"ttt______________________________"<<endl; cout<<"ttttwelcome to Menu"<<endl; cout<<"tttt1:Enter Record"<<endl; cout<<"tttt2:Show Record"<<endl; cout<<"tttt3:Modify Record"<<endl; cout<<"tttt4:Hide Record"<<endl; cout<<"tttt5:Delete Record"<<endl; cout<<"tttt6:Modify Password"<<endl; cout<<"tttt7:Search Record"<<endl; cout<<"tttt8:Exit Menu"<<endl; cout<<"ttt______________________________"<<endl; int choice; cout<<"Enter your choice:t"; cin>>choice; switch(choice) { case 1: entrec(); break; case 2: show(); break; case 3: mdf(); break; case 4: hid(); break; case 5: case 6: srch(); del(); break; modpass(); break; case 7: break; case 8: exit(); } menu(); break;
  • 6. } void modpass() { system("cls"); cout<<"ttEnter new password"<<endl; char pw; int i=0; cin>>user.pass; system("cls"); cout<<"ttPassword Cahnged"<<endl; cout<<"ttPress Enter to Continue"<<endl; pass(); getch(); } void entrec() { system("cls"); cout<<"enter number of record you want to add"<<endl; int n; cin>>n; for(int i=1;i<=n;i++) { cout<<"_______________"<<endl; cout<<"enter 1st name :t"; cin>>p[i].ful_name.first_name; cout<<"enter last name:t"; cin>>p[i].ful_name.last_name; cout<<"address :t"; cin>>p[i].add; cout<<"age :t"; cin>>p[i].age; cout<<"phon :t"; cin>>p[i].phon_num; cout<<"gender :t"; cin>>p[i].gender; getch(); } } void del() { system("cls"); cout<<"enter required out put numbert"<<endl; int n,a; cin>>n;
  • 7. a=0; char lname[20]; cout<<"enter last name to del record"<<endl; cin>>lname; for(int i=1;i<=n;i++){ if(strcmp(p[i].ful_name.last_name,lname)==0) { cout<<"t----------------------------------"<<endl; cout<<"tfirst name:t"<<p[i].ful_name.first_name=='0'; cout<<"tlast name :t"<<(p[i].ful_name.last_name)=='0'; cout<<"taddress :t"<<p[i].add=='0'; cout<<"tphone# :t"<<p[i].phon_num=='0'; cout<<"tage :t"<<p[i].age=='0'; cout<<"tgender :t"<<p[i].gender=='0'; cout<<"t----------------------------------"<<endl; }a++; cout<<"showing records:"<<a<<endl; getch(); } } void mdf() { system("cls"); int n; char lname[20]; cout<<"enter last name"<<endl; cin>>lname; //cout<<"search upto ....num?"<<endl; //cin>>n; for(int i=1;i<=9;i++) { if(strcmp(p[i].ful_name.last_name,lname)==0) { cout<<"enter 1st name:t"; cin>>p[i].ful_name.first_name; cout<<"enter last name:t"; cin>>p[i].ful_name.last_name; cout<<"address:t"; cin>>p[i].add; cout<<"age:t"; cin>>p[i].age; cout<<"phon:t";
  • 8. cin>>p[i].phon_num; cout<<"gender:t"; cin>>p[i].gender; } //getch(); } getch(); menu(); } void show1() { system("cls"); for(int i=1;i<=5;i++) { cout<<"t----------------------------------"<<endl; cout<<"tfirst name:tt"<<p[i].ful_name.first_name<<endl; cout<<"tlast name :tt"<<p[i].ful_name.first_name<<endl; cout<<"taddress :tt"<<p[i].add<<endl; cout<<"tage :tt"<<p[i].phon_num<<endl; cout<<"tgendr :tt"<<p[i].age<<endl; cout<<"tphon num :tt"<<p[i].gender<<endl; cout<<"t----------------------------------"<<endl; } //break; getch(); } void exit() { exit(0); } void hid() { char hide[t]; for (int t=0;t<10;t++) hide[t]=0; char nme[20]; char h; h=0; cout<<"Please Enter last name to hide:"; cin>>nme; for (int i=0;i<9;i++)
  • 9. { if (strcmp(p[i].ful_name.last_name,nme)==0) { hide[i]=1; } h=1; } cout<<"Hidden Successful"<<endl; if (h==0) cout<<"Record not Available"<<endl; getch(); menu(); } void srch() { system("cls"); char hide[10]; for (int t=0;t<10;t++) hide[t]=0; char nm[20]; char a; a=0; cout<<"nEnter Patient Last Name:"; cin>>nm; for (int i=0;i<9;i++) { if (strcmp(p[i].ful_name.last_name,nm)==0 && hide[i]==0) { cout<<"tt------------------------"; cout<<"ntt1 Record match!!!n"; cout<<"nttFirst Name :"; cout<<p[i].ful_name.first_name; cout<<"nttPatient Last Name :"; cout<<p[i].ful_name.last_name; cout<<"nttPatient Phone number:"; cout<<p[i].phon_num; cout<<"nttPatient Age :"; cout<<p[i].age; cout<<"nttPatient gender :"; cout<<p[i].gender<<endl; cout<<"tt------------------------n"; cout<<"nnn"; a=1; }
  • 10. } getch(); menu();} if (a==0) cout<<"nRecord not availablen"; void show() { system("cls"); char hide[10]; for (int t=0;t<10;t++) hide[t]=0; for (int i=0;i<9;i++) { if (hide[i]==0&& strlen(p[i].ful_name.last_name)>0) { cout<<"nRecord number t :"<<i+1; cout<<"nPatient First Namet :"; cout<<p[i].ful_name.first_name; cout<<"nPatient Last Namet :"; cout<<p[i].ful_name.last_name; cout<<"nPatient Phone numbert:"; cout<<p[i].phon_num; cout<<"nPatient Address t:"; cout<<p[i].add; cout<<"nPatient Age t:"; cout<<p[i].age; cout<<"nPatient gender t:"; cout<<p[i].gender; cout<<endl; } }getch(); } /*void del() { system("cls"); char name[22]; cout<<"enter 1st name to dell"<<endl; cin>>name; int a,b; for(int i=0;i<=9;i++) { a=strcmp(name,p[i].ful_name.first_name);