Create a class named Customer that will determine the monthly repayment amount due by a customer...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 dasses. Prompt the user for data for the first object where no interest applies and display the resuits; then prompt the user for data where interest is applicable and display the results. Sample Screen Shots: Customer Name 2 Please enter the customer name Joe Bloggs Customer Contact 2 Please enter the customer contact number 0821121547 OK Cancel OK Cancel Product Price ? Please enter the price of the product 5000 OK Cancel Number of Months ? Please enter the number of repayment months 10 OK Cancel The following output is where interest is applicable: Message Customer Name: Joe Bloggs Customer Contact: 0821121547 Product Amount: R 5,000 Repayment Months: 10 Monthly Repayment:R 625 Total Due: R 6,250 OK The following output is when interest is NOT applicable: Message 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 OK Question 1 Mark Allocation Marking Guideline Mark Examiner Moderator Correct Customer class created 8 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 2 1 Comments TOTAL 35 1. 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 dasses. Prompt the user for data for the first object where no interest applies and display the resuits; then prompt the user for data where interest is applicable and display the results. Sample Screen Shots: Customer Name 2 Please enter the customer name Joe Bloggs Customer Contact 2 Please enter the customer contact number 0821121547 OK Cancel OK Cancel Product Price ? Please enter the price of the product 5000 OK Cancel Number of Months ? Please enter the number of repayment months 10 OK Cancel The following output is where interest is applicable: Message Customer Name: Joe Bloggs Customer Contact: 0821121547 Product Amount: R 5,000 Repayment Months: 10 Monthly Repayment:R 625 Total Due: R 6,250 OK The following output is when interest is NOT applicable: Message 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 OK Question 1 Mark Allocation Marking Guideline Mark Examiner Moderator Correct Customer class created 8 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 2 1 Comments TOTAL 35 1.
Expert Answer:
Answer rating: 100% (QA)
import javaxswingJOptionPane public class CustomerFinance public static void mainString args TODO Au... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
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...
-
Create a Visual Logic flow chart with four methods. Main method will create an array of 5 elements, then it will call a read method, a sort method and a print method passing the array to each. The...
-
Create a class named Aircraft Each Aircraft contains a model code, number of seats, and sale price Model code can be 3, 7, or 8 If the model code is 3, the number of seats is 200, and the sale price...
-
Anon Amus Inc. operates a woodworking shop that makes tables and chairs. He has 25 employees working 40 hours per week and he has 750 hours per week available in machine time. Ralph knows that he...
-
Dust falls on Chicago at a rate of 65 mg m-2 day-1. Major metallic elements in the dust include Al, Mg, Cu, Zn, Mn, and Pb.5 Pb accumulates at a rate of 0.03 mg m-2 day-1. How many metric tons (1...
-
Magna Inc. is considering modernizing its production facility by investing in new equipment and selling the old equipment. The following information has been collected on this investment:...
-
Comment on this statement: Dynamic modeling is about interaction.
-
Three police officers, including Maria Trevizo, were on patrol in Tucson, Arizona, near a neighborhood associated with the Crips gang, when they pulled over a car with a suspended registration. Each...
-
what extent does the ethos of Continuous Improvement engender a mindset of proactive problem-solving and iterative optimization, thereby engendering a virtuous cycle of refinement that propels...
-
An insurance company will insure a $ 50,000 diamond for its full value against theft at a premium of $ 400 per year. Suppose that the probability that the diamond will be stolen is .005, and let x...
-
Northem Ltd makes two products A and B. Information retating to each of these products is set out below. B Seling price per unit E100 E120 Material cost per unit 45 60 Labour time per unit 2 hours 2...
-
On 1 July 2024, Babakin Ltd acquired all the issued shares of Moruya Ltd, paying $50 000 cash and transferring 100 000 of its own shares to Moruya Ltd's former shareholders. The fair value of Babakin...
-
During its fiscal year ended June 3 0 , 2 0 2 4 , Cedar City issued purchase orders totaling $ 3 , 6 0 0 , 0 0 0 , which were properly charged to Encumbrances at that time. Cedar received goods and...
-
On August 10, 2017, Sophia purchased and placed into service a commercial building (39 years SL) for $3.000,000 (building $2,250,000 and land $750,000). On January 1, 2022, the commercial building...
-
On September 30, 2024, a company acquired a patent. The agreement specified that the company will pay $1,110,000 immediately and then another $1,110,000 on September 30, 2026. An interest rate of 9%...
-
Blockchain Company reported income tax expense on their income statement of $256,000. Additional information reported on their balance sheet includes the following: Beginning income taxes payable...
-
The most recent financial statements for Assouad, Incorporated, are shown here: Income Statement Balance Sheet $ Sales Costs Current assets $6,000 Current liabilities $3,600 11,900 8,500 Fixed assets...
-
Study the pictures/images below. Obviously these was focus on LT sociology, anthropology and poltical science. Try to do some analysis by finding clues that are synonymous with the main concepts....
-
The String class replace() method replaces ____________. a. A String with a character b. One String with another String c. One character in a String with another character d. Every occurrence of a...
-
Which assignment is correct in Java? a. char aChar = 5.5; b. char aChar = W; c. char aChar = '*'; d. Two of these are correct.
-
Name at least three classes to which each of these objects might belong: a. myGrandmothersBrooch b. eggsBenedict c. cookieMonster
-
For each of the following sets of numbers, calculate a \(95 \%\) confidence interval for the mean ( \(\sigma\) known); before going through the steps in calculating the confidence interval, the...
-
Consider a 3 -year \(10 \%\) coupon bond. The underlying short rate of interest follows a lattice with initial value of \(R=1.15\) and then has an factor of 1.02 , a down factor of .99 , and...
-
Using the density function of the stopping time probability for a fixed \(\lambda\), find the average time to the first event over the entire interval \([0, \infty)\).
Study smarter with the SolutionInn App