Question
Design a class named Employee having data members for employee ID, employee name, and
monthly salary. Implement member functions to
Answer :
Word Count : 874
_______ ________ _____ _______ _____ _____ ______ ______ _______ __________ ____ _________.
______ ___ ______ ____ _____ _____ ______ ____ ___ _________ ________.
__________ _________ ________ ________ ________ __________ __________ _______.
____ _________ ________ __________ _______ ____.
__________ ________ _______ _________ ________ _______.
___ ____ _____ ____ ______.
__________ _________ ___ _____ ________ ________ ______ ____ __________ _________.
__________ ___ __________ ________ _______ __________ ____.
________ __________ __________ ________ _______ __________ ______ ___ ________.
________ _____ _______ _____ _________ ____ _____ __________ ______.
__________ ________ _______ _________ ______ _________ _____ ___ _________.
______ __________ ________ ________ _________.
______ __________ _____ __________ _________ _____ _____ ______.
____ ____ ______ ______ __________ ____ _______ _____ _________ _________.
___ _______ _______ _________ _____ ___ ___ ________ ____ _______ _________.
_____ _________ _______ ______ _____ _______ ___ ______ ________ ___ ________.
__________ _________ ________ _______ _______ _______.
________ __________ _________ _______ ____ ______ ____ _____ ________ __________ ____.
___ _______ ______ ____ ____ ________ _______ ___ _______ _______ ___.
_______ ____ _________ ______ __________ _________.
_______ _____ _________ _______ _____ _________ __________ ___ ______ ___ ___ __________.
_____ _________ __________ _________ __________ _____ _________ ______.
_________ ______ ________ ___ ________ _____ ____ ____ ____ ______ _____.
_____ _________ ______ ____ __________ ______ ___ __________ ___ _________.
___ _____ ______ __________ ____ ________ _____ _________.
_________ ______ _______ ________ ___ _______ ___ _____ _______ _______ ________ _____.
________ ______ ______ _______ ___ _____ ___ _____ _________.
__________ __________ _______ ____ _________.
_________ ________ ______ ____ ____ ____.
____ _______ ____ _________ _________ __________ _______ _______.
______ ________ ________ ______ ____ __________ _________ ___ _______.
_____ _______ _________ ____ ______ _________ ____ _________ _________ _______ _________.
_____ ___ _______ _________ ________ _______ _________ __________ ____ __________ _________ __________.
_________ ______ ________ _______ ___ ________ _________.
______ ____ _____ _____ ______ ______ ______ _____ _______.
____ _________ __________ ________ ___ ______ ____ ________ _________ ____.
___ _____ ____ ____ __________.
___ ______ ______ _________ ______.
__________ ____ ____ ______ ____ ______ ___ _____ ____ _________.
_______ _____ _____ __________ _____ _____ ______ ______ _____ _________ ______ _________.
______ _____ ____ ____ ____ _________ _________ ___ ___ ____.
______ __________ ________ ______ ___.
__________ ____ ________ ______ ___ ___ _____ _______ _____ _______ ___.
________ _________ __________ ____ __________ __________ ________.
______ _____ __________ ______ ________ ______ ______ _________ ______ ________ ________ ________.
_______ ____ ______ _________ _____ _________ _____ ________ _________ __________.
______ _____ _____ _______ _______ _________ __________ _________ _____ _________.
______ ______ _________ _____ ______.
________ ___ ______ _____ ____ ____ ___ _______ __________ ______.
______ ___ ________ __________ _____ _____ ____ ________ _____ ______ ____.
__________ __________ _______ ___ __________ __________ ________ _____ __________ _________.
______ ____ ______ ________ ___ ______ ____ _____.
________ ______ _________ ______ ________ _______ __________ __________ _________ _________ _________.
_______ _____ ________ _________ ___ ______ ___ ____ _______ ____.
________ __________ ______ _____ ___.
___ __________ ______ _________ ____ ___ ______ __________ ___ ____ ___ _______.
_____ _____ ________ __________ _______ __________ _________ ____ ___.
____ _________ _____ ____ ___ _____.
______ __________ _____ ___ ____ __________ _____ _______.
_______ ____ ___ _______ _________ __________ ______ _____ ___.
___ ________ _________ _____ _____.
_______ _______ _______ ___ _________ ____ ______ __________.
__________ ____ ___ ______ _____ ___ ____ _____.
___ _______ ____ ______ ____ __________ ________.
___ _______ ______ ____ ______ ________ _______ ___ ______ ___.
________ __________ ______ ______ _______ ______ ______ _______ _____ ________.
_________ _____ __________ _______ ______ ____ _____ ______ __________.
____ ____ ________ _________ _________ ________.
____ _____ _____ _______ _____ _________ __________ _______ _____.
__________ _______ _____ __________ _________ __________ _________ __________ ______ ____.
____ ________ ___ _______ ___ _________ _____ ______ ____ __________.
_______ ___ __________ ____ ___ ___ ________ ____ ______ __________.
_________ _______ _______ ______ _____ _____ _______ ______ _____ __________ _______ _________.
____ _____ _______ ____ ___.
_______ _________ __________ __________ _______ _____ _____ _____.
_____ ____ ______ _________ ______.
________ ___ _____ ______ ______ _____.
___ _______ ________ ___ ___ ___ ________ ___ _____.
__________ __________ _______ _________ __________ ________ _______ _____ ______.
Skip in 10
A class named `Employee` can be designed in C++ to represent the basic information of an employee, such as employee ID, employee name, and monthly salary. The class can contain private data members to protect the employee information from direct access outside the class. Public member functions can then be used to initialize, modify, and display the employee details. Encapsulation, one of the important principles of object-oriented programming, is achieved through this arrangement. The employee ID can be stored using an integer data type, while the employee name can be stored using the `string` data type. Since salary may contain decimal values, it is appropriate to use `float` or `double`. The `double` data type is generally preferred because it provides greater precision for monetary calculations. A suitable implementation of the `Employee` class is as follows: ```cpp #include #include using namespace std; class Employee { private: int employeeID; string employeeName; double monthlySalary; public: void getData() { cout << "Enter Employee ID: "; cin >> employeeID; cin.ignore(); cout << "Enter Employee Name: "; getline(cin, employeeName); cout << "Enter Monthly Salary: "; cin >> monthlySalary;
__________ _______ ____ ____ ___._______ ________ _____ _______ _____ _____ ______ ______ _______ __________ ____ _________.
______ ___ ______ ____ _____ _____ ______ ____ ___ _________ ________.
__________ _________ ________ ________ ________ __________ __________ _______.
____ _________ ________ __________ _______ ____.
__________ ________ _______ _________ ________ _______.
___ ____ _____ ____ ______.
__________ _________ ___ _____ ________ ________ ______ ____ __________ _________.
__________ ___ __________ ________ _______ __________ ____.
________ __________ __________ ________ _______ __________ ______ ___ ________.
________ _____ _______ _____ _________ ____ _____ __________ ______.
__________ ________ _______ _________ ______ _________ _____ ___ _________.
______ __________ ________ ________ _________.
______ __________ _____ __________ _________ _____ _____ ______.
____ ____ ______ ______ __________ ____ _______ _____ _________ _________.
___ _______ _______ _________ _____ ___ ___ ________ ____ _______ _________.
_____ _________ _______ ______ _____ _______ ___ ______ ________ ___ ________.
__________ _________ ________ _______ _______ _______.
________ __________ _________ _______ ____ ______ ____ _____ ________ __________ ____.
___ _______ ______ ____ ____ ________ _______ ___ _______ _______ ___.
_______ ____ _________ ______ __________ _________.
_______ _____ _________ _______ _____ _________ __________ ___ ______ ___ ___ __________.
_____ _________ __________ _________ __________ _____ _________ ______.
_________ ______ ________ ___ ________ _____ ____ ____ ____ ______ _____.
_____ _________ ______ ____ __________ ______ ___ __________ ___ _________.
___ _____ ______ __________ ____ ________ _____ _________.
_________ ______ _______ ________ ___ _______ ___ _____ _______ _______ ________ _____.
________ ______ ______ _______ ___ _____ ___ _____ _________.
__________ __________ _______ ____ _________.
_________ ________ ______ ____ ____ ____.
____ _______ ____ _________ _________ __________ _______ _______.
______ ________ ________ ______ ____ __________ _________ ___ _______.
_____ _______ _________ ____ ______ _________ ____ _________ _________ _______ _________.
_____ ___ _______ _________ ________ _______ _________ __________ ____ __________ _________ __________.
_________ ______ ________ _______ ___ ________ _________.
______ ____ _____ _____ ______ ______ ______ _____ _______.
____ _________ __________ ________ ___ ______ ____ ________ _________ ____.
___ _____ ____ ____ __________.
___ ______ ______ _________ ______.
__________ ____ ____ ______ ____ ______ ___ _____ ____ _________.
_______ _____ _____ __________ _____ _____ ______ ______ _____ _________ ______ _________.
______ _____ ____ ____ ____ _________ _________ ___ ___ ____.
______ __________ ________ ______ ___.
__________ ____ ________ ______ ___ ___ _____ _______ _____ _______ ___.
________ _________ __________ ____ __________ __________ ________.
______ _____ __________ ______ ________ ______ ______ _________ ______ ________ ________ ________.
_______ ____ ______ _________ _____ _________ _____ ________ _________ __________.
______ _____ _____ _______ _______ _________ __________ _________ _____ _________.
______ ______ _________ _____ ______.
________ ___ ______ _____ ____ ____ ___ _______ __________ ______.
______ ___ ________ __________ _____ _____ ____ ________ _____ ______ ____.
__________ __________ _______ ___ __________ __________ ________ _____ __________ _________.
______ ____ ______ ________ ___ ______ ____ _____.
________ ______ _________ ______ ________ _______ __________ __________ _________ _________ _________.
_______ _____ ________ _________ ___ ______ ___ ____ _______ ____.
________ __________ ______ _____ ___.
___ __________ ______ _________ ____ ___ ______ __________ ___ ____ ___ _______.
_____ _____ ________ __________ _______ __________ _________ ____ ___.
____ _________ _____ ____ ___ _____.
______ __________ _____ ___ ____ __________ _____ _______.
_______ ____ ___ _______ _________ __________ ______ _____ ___.
___ ________ _________ _____ _____.
_______ _______ _______ ___ _________ ____ ______ __________.
__________ ____ ___ ______ _____ ___ ____ _____.
___ _______ ____ ______ ____ __________ ________.
___ _______ ______ ____ ______ ________ _______ ___ ______ ___.
________ __________ ______ ______ _______ ______ ______ _______ _____ ________.
_________ _____ __________ _______ ______ ____ _____ ______ __________.
____ ____ ________ _________ _________ ________.
____ _____ _____ _______ _____ _________ __________ _______ _____.
__________ _______ _____ __________ _________ __________ _________ __________ ______ ____.
____ ________ ___ _______ ___ _________ _____ ______ ____ __________.
_______ ___ __________ ____ ___ ___ ________ ____ ______ __________.
_________ _______ _______ ______ _____ _____ _______ ______ _____ __________ _______ _________.
____ _____ _______ ____ ___.
_______ _________ __________ __________ _______ _____ _____ _____.
_____ ____ ______ _________ ______.
________ ___ _____ ______ ______ _____.
___ _______ ________ ___ ___ ___ ________ ___ _____.
__________ __________ _______ _________ __________ ________ _______ _____ ______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.