Professional Documents
Culture Documents
*******TUTION MANIA*******
#include<fstream.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
class users
{
char uname[30];
char unumber[11];
public:
void showdetail()
{
cout<<"Name=";
puts(uname);
cout<<" contact number=";
puts(unumber);
}
};
class institute
{
char name[30] ;
char tname[30];
char qualification[ 30];
int experience;
int nobatch;
char btime[30];
int fee;
char address[200];
char no[11];
public :
Page 1
Project
void iname()
{
puts(name);
}
void tdetail()
{
cout<<"Name=";
puts(tname);
cout<<endl<<"Qualification=";
puts(qualification);
cout<<endl<<"experience="<<experience;
}
void bdetail()
{
cout<<endl<<"Number of batches="<<nobatch;
cout<<endl<<"Batch timing =";
puts(btime);
}
void moredetail()
{
cout<<endl<<" Fee charge for the one session is "<<fee;
cout<<endl<<" Address of the institute is=";
puts(address);
cout<<endl<<"For further detail please contact the institute";
cout<<endl<<"Here the contact no.=";
puts(no);
}
void getdetail()
{
cout<<"Enter institue name=";
gets(name);
cout<<endl<<"Enter teacher name=";
gets(tname);
cout<<endl<<"Enter the experience (in year)=";
cin>>experience;
cout<<endl<<"Enter qualifications of teacher=";
gets(qualification);
cout<<endl<<"How my batches are their in this institute=";
cin>>nobatch;
cout<<endl<<"Please enter the bacth timings=";
gets(btime);
cout<<endl<<"Enter the one seesion fee charge by them=";
cin>>fee;
cout<<endl<<"Enter the address of the institute=";
gets (address);
cout<<endl<<"Enter the contact number of the institute=";
gets(no);
cout<<endl<<"Thanks for giving these details";
Page 2
Project
};
void main ()
{
char name[30];
int ch;
long password;
institute A;
cout<<"Hi welcome to TUTION MANIA"<<endl<<endl;
cout<<"Please enter your name=";
gets(name);
clrscr();
cout<<endl<<"NAMASTA "<<name<<endl<<"So,";
cout<<name<<" in which thing do you interested"<<endl;
cout<<"TUTION MANIA give you two option;-"<<endl;
cout<<"1->User"<<endl<<"2->Admin(you should have your password";
cout<<endl<<" plz enter your choice =";
cin>>ch;
clrscr();
if (ch==2)
{
cout<<endl<<name<<" you choose Admin option so for further option please enter
your password =";
cin>>password;
while(password!=123456)
{
int i=0;
cout<<endl<<"Wrong password please try again";
cin>>password;
clrscr();
if(password==123456)
break;
if(i==1);
exit(1);
i++;
}
clrscr();
cout<<endl<<"CONGRATULATION "<<name<<" you successfully login as Admin";
cout<<endl<<"Admin side give you option to add detail of institute and to know
the details of previous users";
B:
Page 3
Project
cout<<endl<<"1-> For add details"<<endl<<"2-> For details of previous users";
cout<<endl<<"Please enter your choice=";
cin>>ch;
clrscr();
if(ch==2)
{
ifstream e("user.dat");
users u ;
cout<<endl<<"Here are the list of the Users who resently uses TUTION MANIA ";
ch=1;
while(e.read((char*)&u,sizeof(u)))
{
cout <<endl<<ch<<"-> ";
u.showdetail();
ch++;
}
getch();
clrscr();
cout<<endl<<"1-> To go back"<<endl<<" 2-> exit ";
cin>>ch;
if(ch==1)
goto B;
else
cout<<endl<<"THANKS for using TUTION MANIA "<<name<<" have a nice
day.......TATA";
getch();
exit(1);
}
else
{
cout<<endl<<"Now, "<<name<<" in which subject do you interested=";
A :
cout<<endl<<"1->Physics"<<endl<<"2->Chemistry"<<endl<<"3->Maths"<<endl<<"4->Biol
ogy";
cout<<endl<<"Please enter your subject choice=";
cin>>ch;
clrscr();
cout<<endl<<name<<" you choose ";
ofstream o;
switch(ch)
{
case 1: cout<<"Physics";
o.open("P.dat" ,ios::binary|ios::app);
break;
case 2 : cout<<"Chemistry";
o.open("C.dat" ,ios::binary|ios::app);
break;
case 3 : cout<<"Maths";
o.open("M.dat" ,ios::binary|ios::app);
break;
Page 4
Project
case 4 : cout<<"Biology";
o.open("B.dat" ,ios::binary|ios::app);
break;
default : cout<<"Nothing";
exit(1);
cout<<endl<<name<<" enter the below mention detail of the institute you want to
add to TUTION MANIA"<<endl;
A.getdetail( );
o.write( (char*)&A,sizeof(A));
clrscr();
cout<<endl<<"Do you want to add more record";
cout<<endl<<"1 for yes"<<endl<<"2 for no"<<endl<<" what do you want=";
cin>>ch;
clrscr();
o.close();
if(ch==1)
goto A;
cout<<endl<<"Thanks "<<name<<" have a nice day.....TATA";
getch();
}
}
else
{
clrscr();
Page 5
Project
switch(ch)
{
case 1: cout<<"Physics";
r.open("P.dat" ,ios::binary|ios::in);
break;
case 2 : cout<<"Chemistry";
r.open("C.dat" ,ios::binary|ios::in);
break;
case 3 : cout<<"Maths";
r.open("M.dat" ,ios::binary|ios::in);
break;
case 4 : cout<<"Biology";
r.open("B.dat" ,ios::binary|ios::in);
break;
default : cout<<"Nothing";
exit(1);
if( ch==1)
{
A.bdetail();
Page 6
Project
cout<<endl<<"If you are intrested please enter 1"<<endl<<" Otherwise 2 for skip
this";
cin>>ch;
clrscr();
if(ch==1)
{
ofstream h("user.dat",ios::binary|ios::app);
users c;
char number[11];
clrscr();
cout<<endl<<"For further details please enter your phone number "<<name;
gets(number);
c.add(number,name);
clrscr();
h.write((char*)&c,sizeof(c));
cout<<endl<<"THANKS for giving your detail";
cout<<endl<<"Below are the further details of your selected institute :-";
A.moredetail();
cout<<endl<<"We hope that you soon contact to this institue and get admition in
it ";
if(ch==1)
{
r.close() ;
goto C;
}
else
{
cout<<"THANKS for using TUTION MANIA "<<name;
cout<<" have a nice day.............TATA";
getch();
}
}
}
**********THE END***********
(Subscribe my youtube channel-
CODE lover to know the C++ graphics)
Page 7