OOP Lab # 02 MariaH yderl - OOP.docx
Document Details
Uploaded by Deleted User
Tags
Related
Full Transcript
**COLLEGE OF ELECTRICAL AND MECHANICAL ENGINEERING (NUST)** **CS -- 212: Object Oriented Programming** **[Lab \# 02: Introduction to Classes]** ==================================================== **Course Instructor:** Dr. Soyiba **Lab Instructor:** Engr. Ayesha Khanam **[LAB TASKS]** ### Cre...
**COLLEGE OF ELECTRICAL AND MECHANICAL ENGINEERING (NUST)** **CS -- 212: Object Oriented Programming** **[Lab \# 02: Introduction to Classes]** ==================================================== **Course Instructor:** Dr. Soyiba **Lab Instructor:** Engr. Ayesha Khanam **[LAB TASKS]** ### Create a class Employee, create functions for the following: a. Input Employee Details b. Display Employee Details **Code:** \#include \ using namespace std; class Employee { private: double EmployeeID; string EmployeeName; double EmployeeSalary; public: // using setter for employee details void setEmployeeID(double id) { EmployeeID = id; } void setEmployeeName(string n) { EmployeeName = n; } void setEmployeeSalary(double s) { EmployeeSalary = s; } // using getter for employee details double getEmployeeID() { return EmployeeID; } string getEmployeeName() { return EmployeeName; } double getEmployeeSalary() { return EmployeeSalary; } void displayEmpDetails() { cout \