Question: QUESTION 1: (25 marks) Question 2/9-1/d are based on the following situation Pure Co is a company that provide water purifier services. The company sells


QUESTION 1: (25 marks) Question 2/9-1/d are based on the following situation Pure Co is a company that provide water purifier services. The company sells water purifier and provide services for the maintenance of the purter. You are required to develop a Java application to process the base information and salary of the employer. Consider the tollowing classes and inheritance hierarchy PurecoPersonnel Agents ServicePersonnel public abstract class :PurecoPersonnel Data Members: protected String name: protected String stertid; protected string mykedId; protected int year; Methods: abstract double calcSalary(); public String toString(); public PurecoPersonnel( String _name, String sid, String mykad , int yr) { 7/accessors 7/mutators public class :Agents Data members: private int soldkaterPurifierA; private int soldater Purifiers; private int soldater Purifierc; Methods: T/ normal constructor 1/accessors Il processor T/ printer public class Servicepersonnel Data neubers! private int noof Itemsservices; private boolean complaint; Methods: /or al constructor //accessor /processor 1/printer OOP BCE) FEB 2022 a) Show complete Agents class definiton that inherits from the PureCoPersonnel class. For agent, the calculation of the salary is: Salary= basic salary+ commissions (depends on number of items sold and commission rate) Water Purifier Type Price RM3900 RM4330 RM7400 Commission Rate 4% of the price for each item sold 5% of the price for each item sold 6% of the price for each item sold Note: If the agent's number of years more than 3 years, extra 200 will be added to the salary. (7 marks) b) Show complete Service Personnel class definiton that inherits from the PurecoPersonnel class. For service personnel, the calculation of the salary is: Solary= 50 X no OfitemsServiced Note: - if the service personnel number of years more than 3 years, extra 100 will be added to the salary. - if customer made valid complaint on the service personnel, 2% of the salary will be deducted (5 marks) c) Show an application program that uses concept of polymorphism to i) Store data on the personnel. The number of data to be stored and information of each personnel are given by the user. ii) Display the information of each personnel. iii) Determine number or personnelfor both agents and service personnel. iv) Display the name and staff Id for service personnel that received complaint
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
