School Management System Mini Project in C++

Code:

#include<iostream.h>
#include<conio.h>
#include<fstream.h>
void main()
{
clrscr();
int a,b,c,d,e,f,g,h,i,j;
char ch;
x:
z:
w:
cout<<"1. for write data\n2. for read data\n3. for delect data"<<endl;
cout<<"\n\nselect any one number";
//cin>>d;
ch=getch();
switch (ch)
{
case '1':
y:
ofstream inf;
inf.open("hana.txt",ios::ate);
cout<<"\n\nEnter the Roll number = ";
cin>>a;
cout<<"Enter marks = ";
cin>>b;
cout<<"Enter the average = ";
cin>>c;
inf<<a<<endl;
inf<<b<<endl;
inf<<c<<endl;
inf.close();
cout<<"Press 1 for again entry\n\nPress 2 for main menu\n";
cout<<"Select any one number = ";
cin>>f;
if (f==1)
{
clrscr();
goto y;
}
if (f==2)
{
clrscr();
goto w;
}
else
cout<<"Enter for End";
break;
case '2':
ifstream out;
out.open("hana.txt");
while (!out.eof())
{
out>>a;
out>>b;
out>>c;
cout<<a<<endl;
cout<<b<<endl;
cout<<c<<endl;
}
out.close();
cout<<"Press 1 for main menu = ";
cin>>g;
if (g==1)
{
clrscr();
goto z;
}
else
cout<<"Enter for end ";
break;
case '3':
ofstream ind;
ind.open("hana.txt",ios::trunc);
cout<<"\nAll the Data is Delect\n";
cout<<"\nPress 1 main menu = ";
cin>>e;
if (e==1)
{
clrscr();
goto x;
}
else
cout<<"Enter for End";
break;
}
getch();
}

-------------------------------------------------------------------------------------------------------------------


Download CPP File: 



Share To:

Adeel Rasheed

Full Stack Website Developer

Post A Comment:

0 comments so far,add yours