Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PreferredCustomer Class A retail store has a preferred customer plan where customers may earn discounts on all their purchases. The amount of a customers discount

PreferredCustomer Class A retail store has a preferred customer plan where customers may earn discounts on all their purchases. The amount of a customers discount is determined by the amount of the customers cumulative purchases in the store. When a preferred customer spends $500, he or she gets a 5% discount on all future purchases. When a preferred customer spends $1,000, he or she gets a 6% discount on all future purchases. When a preferred customer spends $1,500, he or she gets a 7% discount on all future purchases. When a preferred customer spends $2,000 or more, he or she gets a 10% discount on all future purchases. Design a class named PreferredCustomer , which is derived from the CustomerData class you created in Programming Challenge 7. The PreferredCustomer class should have the following member variables: purchasesAmount (a double ) discountLevel (a double ) The purchasesAmount variable holds the total of a customers purchases to date. The discountLevel variable should be set to the correct discount percentage, according to the stores preferred customer plan. Write appropriate member functions for this class and demonstrate it in a simple program. Input Validation: Do not accept negative values for any sales figures.

C++?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago