(IN java) ABC Company has asked for a Payroll Management system Application to automate their payroll system. In addition to calculating the earnings that must be paid to each employee, the company Page 4 of 5 must also calculate the payment due on each of several invoices (i.e., bills for goods purchased). Though applied to unrelated things (i.e., employees and invoices), both operations have to do with obtaining some kind of payment amount. For an employee, the payment refers to the employee’s earnings. For an invoice, the payment refers to the total cost of the goods listed on the invoice. Consider the following requirement to build the Payroll application. The Payable is an interface to describe the functionality of any object that must be capable of being paid and thus must offer a method to determine the proper payment amount due. It contains method getPaymentAmount that returns a double amount that must be paid for an object of any class that implements the interface. The class Invoice implements interface Payable that represents a simple invoice that contains billing information that is private instance variables partNumber, partDescription, quantity and pricePerItem. Class Invoice also contains a get and set methods that manipulate the class’s instance variables and a toString method that returns a string representation of an Invoice object. Note that methods setQuantity and setPricePerItem ensure that quantity and pricePerItem obtain only nonnegative values. The method getPaymentAmount calculates the total payment required to pay the invoice. The method multiplies the values of quantity and pricePerItem and returns the result. The abstract class Employee implements interface Payable that contains private members named name and socialSecurityNumber. The SalariedEmployee is an Employee and fulfills superclass Employee’s contract to implement method getPaymentAmount of interface Payable. The class contain weeklySalary which should be nonnegative number. This class has method named generateSalesReport that will list the parts sold. The salariedEmployee manages one or many Inovice. The PayableInterfaceTest that interface Payable can be used to process a set of Invoices and Employees polymorphically in a single application. Create Arraylist of payableObject(Payable) that contains four objects of Invoice and Employee. Invokes Payable method getPaymentAmount to obtain the payment amount for each object in payableObjects, regardless of the actual type of the object. Also, highlight the appropriate data types and return types for the data members of the object. Use parameterized constructor to build the objects.
Answers
Answered by
0
Answer:
your questions is too long you search it on Google
Answered by
0
Answer:
I have answer for this
you can contact me at alhassandabzz at fb
Explanation:
Similar questions