Question: (a) Create a class named TripleParkCustomer that inherits Customer. (2 marks) (b) Define totalPaymentAfterDiscount()in TripleParkCustomer to grant a discount of 10% from the total payment.

(a) Create a class named TripleParkCustomer that inherits Customer. (2 marks)
(b) Define totalPaymentAfterDiscount()in TripleParkCustomer to grant a discount of 10% from the total payment. (4 marks)
(c) Define extensionMonth() in TripleParkCustomer to grant an extension of 10 months. (3 marks)
(d) Override display() in TripleParkCustomer to display the payment after discount, the months of extension and the number of free food voucher. (4 marks)
(e) Create a class named DoubleParkCustomer that inherits Customer. (2 marks)
(f) Define totalPaymentAfterDiscount()in DoubleParkCustomer to grant a discount of 5% from the total payment. (4 marks)
(g) Define extensionMonth() in DoubleParkCustomer to grant an extension of 5 months. (3 marks)
(h) Override display() in DoubleParkCustomer to display the payment after discount and the months of extension. (3 marks)
Q3 Answer Q3(a)-Q3(h) based on Figure Q3. abstract class Customer { int extensionMonth; double totalPayment; double discount; final int FREEFOODVOUCHER = 2; public abstract void totalPaymentAfterDiscount(); public abstract void extensionMonth(); public void display() { System.out.println("To display something."); } FIGURE Q3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
