write a C++ programme to create a class by name Employee.
#include <iostream>
#include <string>
using namespace std;
class Employee{
private:
int empno;
string name, designation;
public:
Employee(){
getDetails();
}
void getDetails(){
cout<<"Enter employee number: ";
cin>>empno;
cout<<"Enter employee name: ";
cin>>name;
cout<<"Enter employee designation: ";
cin>>designation;
}
};
Comments
Leave a comment