Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a) Define the Fullime class that inherits from the Employee class. The attributes and methods are as follows: Attributes: base salary and allowance Methods: -
a) Define the Fullime class that inherits from the Employee class. The attributes and methods are as follows: Attributes: base salary and allowance Methods: - Constructor with arguments - tostring (), to return the string representation of the object - calsalary (), given the formulae : base + allowance - calTax (), given the formulae: tax = salary X2%, for salary above 1000 no tax for salary less than and equal to 1000 (7 marks) b) Define the PartTime class that inherits from the Employee class. The attributes and methods are as follows: Attributes: rate and hour Methods: - Constructor with arguments - tostring () , to return the string representation of the object - calsalary(l, given the formulae : hour X rate - caltax(), given the formulae: tax = salary X2%, for salary above 2000 no tax for salary less than and equal to 2000 (7 marks) c) Write a Java application class called Employeep that uses the concept of polymorphism to perform the following tasks: - Declare an array of objects to store data on various types of Employee. - Display the details for all employees, their salary and their tax. - Calculate and display the total number of FullTime employees and total number of all PartTime employees. (16 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started