Answer to Question #257988 in C++ for ace

Question #257988

write a C++ programme to create a class by name Employee.


1
Expert's answer
2021-10-28T07:56:15-0400
#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;
    }
};

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS