Menu

Please Use Java Question 3 Person Customer Classes Design Class Named Person Properties Ho Q43788254

Please use Java

Question 3:

Person and Customer classes:

Design a class named Person with properties for holding aperson’s name, address, and telephone number. Next, design a classnamed Customer, which is derived from the Person class. TheCustomer class should have a property for a customer number and aBoolean property indicating whether wishes to be on a mailing list.Demonstrate an object of customer class in a simple GUIapplication.

  • Write the code include appropriate input validation, error andexception handling code.

A retail store has a preferred customer plan where customers canearn discounts on all their purchases. The amount of discountdepends on customer’s cumulative purchases in the store and thebusiness rules for discounts is as follows:

• When a preferred customer spends $500, he or she gets a 5 %discount on all future purchases.

• When a preferred customer spends $1000, he or she gets a 6 %discount on all future purchases.

• When a preferred customer spends $1500, he or she gets a 7 %discount on all future purchases.

• When a preferred customer spends $2000, he or she gets a 10 %discount on all future purchases.

Design a class called PreferredCustomer, which is derived fromthe Customer class you created in No 3.

The PreferredCustomer class should have properties for theamount of the customer’s purchases and the customer’s discountlevel. Demonstrate the class in a simple GUI application.

• Write the code include appropriate input validation, error andexception handling code.

Expert Answer


Answer to Please use Java Question 3: Person and Customer classes: Design a class named Person with properties for holding a perso…

OR