#include <iostream.>
#include <conio.h>
using namespace std;
class members
{
protected:
int sno;
char name[20];
public:
void getmembers(void)
{
cout<<"\n\nEnter Serial Number: ";
cin>>sno;
cout<<"Enter name: ";
cin>>name;
}
void dispmembers(void)
{
cout<<"\nSerial Number: "<<sno;
cout<<"\nNAME: "<<name;
}
};
class faculty : public members
{
char sub[20];
char desg[20];
public:
void create(void)
{
getmembers();
cout<<"Enter Subject: ";
cin>>sub;
cout<<"Enter Designation: ";
cin>>desg;
}
void display(void)
{
dispmembers();
cout<<"\nSUBJECT: "<<sub;
cout<<"\nDESIGNATION: "<<desg;
}
};
class student : public members
{
char grade;
int year;
public:
void create(void)
{
getmembers();
cout<<"Enter Grade: ";
cin>>grade;
cout<<"Enter Admission Year: ";
cin>>year;
}
void display(void)
{
dispmembers();
cout<<"\nGRADE: "<<grade;
cout<<"\nYEAR: "<<year;
}
};
class admin : public members
{
char desg[20];
public:
void getadmin(void)
{
getmembers();
cout<<"Enter Designation: ";
cin>>desg;
}
void dispadmin(void)
{
dispmembers();
cout<<"\nDESINATION: "<<desg;
}
};
class casual : public admin
{
float dailywages;
public:
void create(void)
{
getadmin();
cout<<"Enter Daily Wages: ";
cin>>dailywages;
}
void display(void)
{
dispadmin();
cout<<"\nDAILY WAGES: "<<dailywages;
}
};
void main()
{
faculty o1t[10];
casual o1c[10];
student o1o[10];
int choice,i;
char test;
while(1)
{
int count;
start:
cout<<"\n=====APCOMS INSTITUTION DATABASE=====\n\n\n";
cout<<"Choose Category of Information\n";
cout<<"1) Faculty\n";
cout<<"2) Student\n";
cout<<"3) Admin\n";
cout<<"4) Exit\n";
cout<<"Enter your choice: ";
cin>>choice;
switch(choice)
{
case 1 : while(1)
{
cout<<"\n=====Faculty INFORMATION=====\n\n";
cout<<"\nChoose your choice\n";
cout<<"1) Create\n";
cout<<"2) Display\n";
cout<<"3) Jump to Main Menu\n";
cout<<"Enter your choice: ";
cin>>choice;
switch(choice)
{
case 1 : for(count=0,i=0;i<10;i++)
{
cout<<endl;
o1t[i].create();
count++;
cout<<endl;
cout<<"\n\nAre you Interested in entering data\n";
cout<<"Enter y or n: ";
cin>>test;
if(test=='y' || test=='Y')
continue;
else goto out1;
}
out1:
break;
case 2 : for(i=0;i<count;i++)
{
cout<<endl;
o1t[i].display();
cout<<endl;
}
getch();
break;
case 3 : goto start;
default: cout<<"\nEnter choice is invalid\ntry again\n\n";
}
}
case 2 : while(1)
{
cout<<"\n=====Student INFORMATION=====\n\n";
cout<<"\nChoose your choice\n";
cout<<"1) Create\n";
cout<<"2) Display\n";
cout<<"3) Jump to Main Menu\n";
cout<<"Enter your choice: ";
cin>>choice;
switch(choice)
{
case 1 : for(count=0,i=0;i<10;i++)
{
cout<<endl;
o1o[i].create();
count++;
cout<<endl;
cout<<"\n\nAre you Interested in entering data\n";
cout<<"Enter y or n: ";
cin>>test;
if(test=='y' || test=='Y')
continue;
else goto out2;
}
out2:
break;
case 2 : for(i=0;i<count;i++)
{
cout<<endl;
o1o[i].display();
cout<<endl;
}
getch();
break;
case 3 : goto start;
default: cout<<"\nInvalid choice\ntry again\n\n";
}
}
case 3 : while(1)
{
cout<<"\n=====admin INFORMATION=====\n\n";
cout<<"\nChoose your choice\n";
cout<<"1) Create\n";
cout<<"2) Display\n";
cout<<"3) Jump to Main Menu\n";
cout<<"Enter your choice: ";
cin>>choice;
switch(choice)
{
case 1 : for(count=0,i=0;i<10;i++)
{
cout<<endl;
o1c[i].create();
count++;
cout<<endl;
cout<<"\n\nAre you Interested in entering data\n";
cout<<"Enter y or n: ";
cin>>test;
if(test=='y' || test=='Y')
continue;
else goto out3;
}
out3:
break;
case 2 : for(i=0;i<count;i++)
{
cout<<endl;
o1c[i].display();
cout<<endl;
}
getch();
break;
case 3 : goto start;
default: cout<<"\nInvalid choice\ntry again\n\n";
}
}
case 4 : goto end;
}
}
end:;
}
#include <conio.h>
using namespace std;
class members
{
protected:
int sno;
char name[20];
public:
void getmembers(void)
{
cout<<"\n\nEnter Serial Number: ";
cin>>sno;
cout<<"Enter name: ";
cin>>name;
}
void dispmembers(void)
{
cout<<"\nSerial Number: "<<sno;
cout<<"\nNAME: "<<name;
}
};
class faculty : public members
{
char sub[20];
char desg[20];
public:
void create(void)
{
getmembers();
cout<<"Enter Subject: ";
cin>>sub;
cout<<"Enter Designation: ";
cin>>desg;
}
void display(void)
{
dispmembers();
cout<<"\nSUBJECT: "<<sub;
cout<<"\nDESIGNATION: "<<desg;
}
};
class student : public members
{
char grade;
int year;
public:
void create(void)
{
getmembers();
cout<<"Enter Grade: ";
cin>>grade;
cout<<"Enter Admission Year: ";
cin>>year;
}
void display(void)
{
dispmembers();
cout<<"\nGRADE: "<<grade;
cout<<"\nYEAR: "<<year;
}
};
class admin : public members
{
char desg[20];
public:
void getadmin(void)
{
getmembers();
cout<<"Enter Designation: ";
cin>>desg;
}
void dispadmin(void)
{
dispmembers();
cout<<"\nDESINATION: "<<desg;
}
};
class casual : public admin
{
float dailywages;
public:
void create(void)
{
getadmin();
cout<<"Enter Daily Wages: ";
cin>>dailywages;
}
void display(void)
{
dispadmin();
cout<<"\nDAILY WAGES: "<<dailywages;
}
};
void main()
{
faculty o1t[10];
casual o1c[10];
student o1o[10];
int choice,i;
char test;
while(1)
{
int count;
start:
cout<<"\n=====APCOMS INSTITUTION DATABASE=====\n\n\n";
cout<<"Choose Category of Information\n";
cout<<"1) Faculty\n";
cout<<"2) Student\n";
cout<<"3) Admin\n";
cout<<"4) Exit\n";
cout<<"Enter your choice: ";
cin>>choice;
switch(choice)
{
case 1 : while(1)
{
cout<<"\n=====Faculty INFORMATION=====\n\n";
cout<<"\nChoose your choice\n";
cout<<"1) Create\n";
cout<<"2) Display\n";
cout<<"3) Jump to Main Menu\n";
cout<<"Enter your choice: ";
cin>>choice;
switch(choice)
{
case 1 : for(count=0,i=0;i<10;i++)
{
cout<<endl;
o1t[i].create();
count++;
cout<<endl;
cout<<"\n\nAre you Interested in entering data\n";
cout<<"Enter y or n: ";
cin>>test;
if(test=='y' || test=='Y')
continue;
else goto out1;
}
out1:
break;
case 2 : for(i=0;i<count;i++)
{
cout<<endl;
o1t[i].display();
cout<<endl;
}
getch();
break;
case 3 : goto start;
default: cout<<"\nEnter choice is invalid\ntry again\n\n";
}
}
case 2 : while(1)
{
cout<<"\n=====Student INFORMATION=====\n\n";
cout<<"\nChoose your choice\n";
cout<<"1) Create\n";
cout<<"2) Display\n";
cout<<"3) Jump to Main Menu\n";
cout<<"Enter your choice: ";
cin>>choice;
switch(choice)
{
case 1 : for(count=0,i=0;i<10;i++)
{
cout<<endl;
o1o[i].create();
count++;
cout<<endl;
cout<<"\n\nAre you Interested in entering data\n";
cout<<"Enter y or n: ";
cin>>test;
if(test=='y' || test=='Y')
continue;
else goto out2;
}
out2:
break;
case 2 : for(i=0;i<count;i++)
{
cout<<endl;
o1o[i].display();
cout<<endl;
}
getch();
break;
case 3 : goto start;
default: cout<<"\nInvalid choice\ntry again\n\n";
}
}
case 3 : while(1)
{
cout<<"\n=====admin INFORMATION=====\n\n";
cout<<"\nChoose your choice\n";
cout<<"1) Create\n";
cout<<"2) Display\n";
cout<<"3) Jump to Main Menu\n";
cout<<"Enter your choice: ";
cin>>choice;
switch(choice)
{
case 1 : for(count=0,i=0;i<10;i++)
{
cout<<endl;
o1c[i].create();
count++;
cout<<endl;
cout<<"\n\nAre you Interested in entering data\n";
cout<<"Enter y or n: ";
cin>>test;
if(test=='y' || test=='Y')
continue;
else goto out3;
}
out3:
break;
case 2 : for(i=0;i<count;i++)
{
cout<<endl;
o1c[i].display();
cout<<endl;
}
getch();
break;
case 3 : goto start;
default: cout<<"\nInvalid choice\ntry again\n\n";
}
}
case 4 : goto end;
}
}
end:;
}
0 comments:
Post a Comment