Question: Challenging Problems: Implement the following classes: 1) Class Enployee that includes: - Two instance variables: firstsiame (type string) and lastkine (type string). - A defaul
Challenging Problems: Implement the following classes: 1) Class Enployee that includes: - Two instance variables: firstsiame (type string) and lastkine (type string). - A defaul constructor that initilzes the instance variabies to the defaul values. - A constructor that initializes the instance variables to the values specified as parameters. - Set and get methods for the instance variables. Cpt201 Computer fngineering Department - A method costring that return a string representation of employee's frst and last name. 2) Class Salary that includes: - Two instance variables: workingreara (type float) and workinggate (type foat) and one instance object enpoby that is an object of the Enployee class. - A constructor that initializes the two instance variables. If the workingrears is negative, set it to 0 . Othenwise, If the workingYears is less than or equal to 12 years. then workingtate will be equal to 110.8. Otherwise, t will be equal to 210.3 . - A method called calsalary that computes and returns the monthly salary of the employee (Salary = working years " working_rate). - A method greater Salary that has two Salary objects as parameters and returns True if the first salary is greater than the second one. Oherwise return False. - A method tostring that will return a string representation of employee's frst, last name and monthly salary. 3) Class salarytent that has a main method to test your classes. The main method should do the following: - Create an array of two references to Salary objects. - Input two salary information (f1 rackane, 1 ast Mane and workingyears). - Create two Salary objects and display each object's attributes needed. - Compare the two objects' salary by calling gseater salary method. Sample output: Sample output First Namen khaili Lase Katet Nta Year of enploymat: Please eacer enployne (2) info: rirst siamer Moherind lant Nanet Tahad Yours of enploynent: 10 Khalda A.1 gets a menth1y a alary of 5257.5 10 Mohanewd Fahad getn a nonthly salary of 110e,0 kn Khald Alt has a bigher salary than Nohased Fahad
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
