[ create a new paste ] login | about

Link: http://codepad.org/0G4BuhFW    [ raw code | output | fork ]

C++, pasted on May 28:
//------------------------------------------------------------------------------------------------ 
#include <iostream>
//#include <conio.h>
using namespace std;
//-------------------------------------------------------
enum status{laborant, decan, proffessor};
//-------------------------------------------------------
class date
{
private:
int day;
int month;
int year;
char m;
public:
date(): day(0), month(0), year(0), m('/')
{}
void getdate()
{
cout<<"Enter date in format [day/month/year]: ";
cin>>day>>m>>month>>m>>year;
}
void showdate()
{cout<<"Date poluchki: "<<day<<m<<month<<m<<year;}
};
//------------------------------------------------------
class employ
{
private:
int number;
float oclad;
date poluchka;
status doljnost;
char st;
public:
void setemploy()
{
cout<<"\nEnter the number of woker: "; cin>>number;
cout<<"Enter the oklad of woker: "; cin>>oclad;
poluchka.getdate();
cout<<"Enter the 1st letter in word status [laborant, decan, proffessor]: ";
//st=getch();
switch(st)
{
case 'l':
doljnost=laborant;
break;
case 'd':
doljnost= decan;
break;
case 'p':
doljnost = proffessor;
}
}
void display()
{
cout<<"\n\nThe number of woker: "<<number<<endl;
cout<<"The oclad of woker: "<<oclad<<endl;
poluchka.showdate();
switch(doljnost)
{case 0:
cout<<"\nStatus - laborant";
break;
case 1:
cout<<"\nStatus - decan";
break;
case 2:
cout<<"\nStatus - proffessor";
break;
}
}
};
//----------------------------------------------
int main()
{
employ cool, mike;
cool.setemploy();
mike.setemploy();
cout<<"\n\n C O O L\n";
cool.display();
cout<<"\n\n M I K E\n";
mike.display();
//getch();
return 0;
}
//------------------------------------------------------------------------------------------------


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

Enter the number of woker: Enter the oklad of woker: Enter date in format [day/month/year]: Enter the 1st letter in word status [laborant, decan, proffessor]: 
Enter the number of woker: Enter the oklad of woker: Enter date in format [day/month/year]: Enter the 1st letter in word status [laborant, decan, proffessor]: 

 C O O L


The number of woker: 1073829312
The oclad of woker: 2.26136
Date poluchki: 0/0/0

 M I K E


The number of woker: 1076285184
The oclad of woker: 2.2539
Date poluchki: 0/0/0


Create a new paste based on this one


Comments: