Question: Java: A retail store has a preferred customer plan where customers can earn discounts on all their purchases. The amount of a customer's discount is

Java:

A retail store has a preferred customer plan where customers can earn discounts on all their purchases. The amount of a customer's discount is determined by the amount of the customer's cumulative purchases in the store, as follows:

When a preferred customer spends $500, they get a 5% discount on all future purchases.

When a preferred customer spends $1,000, they get a 6% discount on all future purchases.

When a preferred customer spends $1,5000, they get a 7% discount on all future purchases.

When a preferred customer spends $2,000, they get a 10% discount on all future purchases.

Design a class named PreferredCustomer, which inherits from the Customer class you created in Exercise 7. The preferredCustomer class should have int fields for the amount of the customer's purchases and the customer's discount level. Write a constructor that initializes these fields as well as accessor and mutator methods. Desmonstrate the class in a program that prompts the user to input the customer's name, address, phone number, customer number, whether they want to recieve mail, and the amount they've spent, and then uses that information to create a PreferredCustomer object and print its information. (Use string formatting to print the amount spent.) Create all of the classes in the same file by not delcaring any of them public.

Run like following one:

Enternameofcustomer:HollyAlto

Enteraddressofcustomer:2797ColonialForestWayzata,Wisconsin53193

Enterphonenumberofcustomer:608-142-1014

Entercustomernumber:668602797

Enteryes/no--doesthecustomerwanttorecievemail?:yes

Enteramountcustomerhasspent:1756

Customer:

Name:HollyAlto

Address:2797ColonialForestWayzata,Wisconsin53193

PhoneNumber:608-142-1014

CustomerNumber:668602797

RecieveMail?:true

AmountPurchased:$1756.00

Percentoff:7%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To address the given problem and create a PreferredCustomer class that inherits from a Customer class follow these steps Step 1 Define the Customer Class Firstly assume theres a basic Customer class t... View full answer

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!