-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblem_05.cpp
More file actions
50 lines (47 loc) · 1.79 KB
/
Copy pathproblem_05.cpp
File metadata and controls
50 lines (47 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*Write a program that will take employee information such as id, name, age, and salary. After that display all
employee’s information as a table.*/
#include<iostream>
#include<string>
using namespace std;
class EmployeesInfo{
private:
int id,age,salary;;
string name;
public:
EmployeesInfo(int id,string name,int age,int salary){
this->id=id;
this->name=name;
this->age=age;
this->salary=salary;
}
~EmployeesInfo(){
cout<<"\t\t\t\t.|..........Employee’s information Table.............|\n";
cout<<"\t\t\t\t| | |\n";
cout<<"\t\t\t\t| Name | Information |\n";
cout<<"\t\t\t\t|....................................................|\n";
cout<<"\t\t\t\t|Employee id : |"<<id<<" |\n";
cout<<"\t\t\t\t|....................................................|\n";
cout<<"\t\t\t\t|Employee name : |"<<name<<" |\n";
cout<<"\t\t\t\t|....................................................|\n";
cout<<"\t\t\t\t|Employee age : |"<<age<<" |\n";
cout<<"\t\t\t\t|....................................................|\n";
cout<<"\t\t\t\t|Employee salary :|"<<salary<<" |\n";
cout<<"\t\t\t\t|....................................................|\n";
cout<<"\t\t\t\t| | |\n";
cout<<"\t\t\t\t|....................................................|\n";
}
};
int main(){
int id,age,salary;
string name;
cout<<"Enter your ID:\n";
cin>>id;
cout<<"Enter name:\n";
cin.ignore();
getline(cin,name);
cout<<"Enter age:\n";
cin>>age;
cout<<"Enter salarary:\n";
cin>>salary;
EmployeesInfo obj(id,name,age,salary);
}