Question

Summative Question 22

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 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 number 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.


3 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Summative Question 22
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Question 1 (Marks: 35) Create a class named Customer that will determine the monthly repayment amount...

    Question 1 (Marks: 35) 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 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...

  • C++ Visul Studio Create a class named Vehicle. The class has the following five member variables:...

    C++ Visul Studio Create a class named Vehicle. The class has the following five member variables: • Vehicle Name • Vehicle number • Sale Tax • Unit price • Total price Include set (mutator) and get (accessor) functions for each field except the total price field. The set function prompt the user for values for each field. This class also needs a function named computePrice() to compute the total price (quantity times unit price + salesTax) and a function to...

  • Part I: Problem: Code the following in Java: Candy Class -price -number of pounds sold Create...

    Part I: Problem: Code the following in Java: Candy Class -price -number of pounds sold Create the following methods: -Two constructors – default and second - accessor and mutator methods for each of the fields. - check for invalid price. Negative price is invalid (use if then else and display error message) - a method named userInput to get user input for all the fields. - check for invalid price. Negative price is invalid (use a loop to prompt the...

  • a. Create a class named Lease with fields that hold an apartment tenant's name, apartment Number,...

    a. Create a class named Lease with fields that hold an apartment tenant's name, apartment Number, monthly rent amount, and term of the lease in months. Include a constructor that initializes the name. "XXX", the apartment number to O, the rent to 1000, and the term to 12. Also include methods to get and set each of the fields. Include a nonstatic method named addPetFee() that adds $10 to the monthly rent value and calls a static method named explainPetPolicy...

  • java Invoice class

    Create a class named Invoice that contains fields for an item number, name, quantity, price, and total cost. Create insurance methods that set the item name, quantity,and price. Whenever the price for quantity is set, recalculate the total (price times quantity). Also include a display Line() method that displays the item number,name, quantity, price, and total cost. Make sure you include a class named TestInvoice whose main method () declares three Invoice items. Create a method that prompts the user...

  • Create a class named Book that contains data fields for the title and number of pages....

    Create a class named Book that contains data fields for the title and number of pages. Include get and set methods for these fields. Next, create a subclass named Textbook, which contains an additional field that holds a grade level for the Textbook and additional methods to get and set the grade level field. Write an application that demonstrates using objects of each class. Save the files as Book.java, Textbook.java, and DemoBook.java.

  • Design a class named Person with fields for holding a person's name, address, and telephone number...

    Design a class named Person with fields for holding a person's name, address, and telephone number (all as Strings). Write a constructor that initializes all of these values, and mutator and accessor methods for every field. Next, design a class named Customer, which inherits from the Person class. The Customer class should have a String field for the customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write a constructor that initializes...

  • FOR JAVA: Summary: Create a program that stores info on textbooks. The solution should be named...

    FOR JAVA: Summary: Create a program that stores info on textbooks. The solution should be named TextBookSort.java. Include these steps: Create a class titled TextBook that contains fields for the author, title, page count, ISBN, and price. This TextBook class will also provide setter and getter methods for all fields. Save this class in a file titled TextBook.java. Create a class titled TextBookSort with an array that holds 5 instances of the TextBook class, filled without prompting the user for...

  • Create a class named Horse that contains data fields for the name, color, and birth year....

    Create a class named Horse that contains data fields for the name, color, and birth year. Include get and set methods for these fields. Next, create a subclass named RaceHorse, which contains an additional field that holds the number of races in which the horse has competed and additional methods to get and set the new field. Write an application that demonstrates using objects of each class. Save the files as Horse.java, RaceHorse.java, and DemoHorses.java. Program 1 Submission Template Fields:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT