Question: Create a class named Customer that will determine the monthly repayment amount due by a customer for a product bought on credit. The class has
Create a class named Customer that will determine the monthly repayment amount due by a customer for a product bought on credit. The class has five (5) fields: customer name, contact number, product price, number of months and the monthly repayment amount. Write get and set methods for each field, except for the monthly repayment amount field. The set methods must prompt the user to enter the values for the following fields: customer name, contact number, product price and number of months. This class also needs a method to calculate the monthly repayment amount (product price divided by the number of months).
Add a subclass named Finance_Period that will determine if a customer will pay interest or not. If the number of months to pay for the product is greater than three, the customer will pay 25% interest, else no interest applies. The maximum amount of months to pay for the product is 12. Override the calculate repayment() method by determining if the customer will pay interest or not and calculate the monthly repayment amount.
Create a class called Customer Finance that contains the logic to test the two classes. Prompt the user for data for the first object where no interest applies and display the results; then prompt the user for data where interest is applicable and display the results.
Sample screen shots
The following output is where interest is applicable:
The following output is when interest is NOT applicable:
Product Price ? Please enter the price of the product 5000 OK Cancel OK Number of Months X ? Please enter the number of repayment months 10 X Cancel Message i Customer Name: Joe Bloggs Customer Contact: 0821121547 Product Amount: R 5,000 Repayment Months: 10 Monthly Repayment: R 625 Total Due: R 6,250 X Message i Customer Name: Joe Bloggs Customer Contact: 0821121547 Product Amount: R 5,000 Repayment Months: 3 Monthly Repayment: R 1,666.67 Total Due: R 5,000 X Marking Guideline Correct Customer class created Correct variables and methods created - 8 marks Attempted but not correct-up to a maximum of 4 marks Not attempted-0 marks Additional calculation class created Subclass with correct calculate_repayment() method - 5 marks Attempted, but not correct-up to a maximum of 2 marks Not attempted-0 marks Get and set methods created in second class Get and set methods created in second class - 4 marks Attempted but not correct - 1 marks Not attempted-0 marks Input and Output (use of JOptionPanes) All input and outputs correct - 4 marks Some correct - up to a maximum of 2 marks Not attempted-0 marks Customer_Finance class created Two objects instantiated and methods applied - 8 marks Attempted, but not totally correct - up to a maximum of 5 marks Not attempted-0 marks Save file correctly Good Programming Practise Code Efficiency Comments TOTAL Mark Examiner Moderator 8 5 8 1 2 1 2 35
Step by Step Solution
3.36 Rating (159 Votes )
There are 3 Steps involved in it
import javaxswingJOptionPane public class CustomerFinance public static void mainString args TODO Au... View full answer

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