Write a class encapsulating the concept of an employee


Problem

Write a class encapsulating the concept of an Employee, assuming that an employee has the following attributes: last name, first name, empId and salary. Make sure that salary is greater than zero. Include two overloaded constructors to set all the four values, the accessors and mutators, and method toString. Also code the following method returning the salary and empId. Write a client class to test all your methods. Create 5 Employees - two with the two overloaded constructors with all four parameters and the other three employees by invoking the default constructor.

Store all these 5 objects in an array and display the employees' information with foreach loop.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a class encapsulating the concept of an employee
Reference No:- TGS02676399

Expected delivery within 24 Hours