Programming Project 71125.docx - Exercise 71125 A retail...

This preview shows page 1 - 2 out of 5 pages.

Exercise 71125A retailstorehas a preferred customer plan where customers can earn discountson all their purchases. The amount of a customer's discount is determinedby the amount of the customer's cumulative purchases in thestore, as follows:When a preferred customer spends $500, they get a 5% discount on allfuture purchases.When a preferred customer spends $1,000, they get a 6% discount on allfuture purchases.When a preferred customer spends $1,5000, they get a 7% discount on allfuture purchases.When a preferred customer spends $2,000, they get a 10% discount on allfuture purchases.Design aclassnamedPreferredCustomer, which inherits from the Customerclassyou created in Exercise 7. The preferredCustomerclassshould haveintfieldsfor the amount of the customer's purchases and the customer's discount level.Write aconstructorthatinitializesthese fields as well as accessor andmutatormethods.Desmonstrate theclassin aprogramthat prompts the user to input thecustomer'sname, address, phone number, customer number,whetherthey want torecieve mail, and the amount they've spent, and then uses that informationto create a PreferredCustomerobjectand print its information. (Use

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture