Question: Given uml and do the following: 1 - Create class / interface that implements the classes + interface displayed in the UML displayed above exactly

Given uml and do the following:1- Create class/interface that implements the classes + interface displayed in the UML displayed above exactly as specified (same variable names, types, ). Make sure to include no-arg + all field constructors, setters + getters, as well as toString() methods in each of the classes created. Please note the following:a- method calculatePayment()is implemented differently in each of the concrete classes as follows:- in class Cash it is calculated as the payment amount entered minus the discountRate percentage (e.g. if amount is 200.0 and discountRate is 11.0 then payment value is 178.0)- in class Check, payment is the same as the amount entered.- in class CreditCard, payment is the amount plus the chargingFee.b- method printPaymentInfo() prints the properties and the calculated payment by calling both the toString() as well as the calculatePayment() methods. c- class CustomerPayment is Comparable based on the value returned by the method calculatePayment().d- Check class has a variable called type (int) which is set using one of three constant values that should be defined in the class ( CASHIER=1, CERTIFIED=2, PERSONAL=3).e- classes Check and CreditCard implement interface Payable by implementing the method isAuthorized() as follows:- A Check payment is authorized if either the type of the check is CASHIER or if the amount of the payment is less than or equal to the accountBalance, otherwise it is not authorized. - A CreditCard payment is authorized if its expiryDate is less than or equal to the current date.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!