Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ PLEASE: A retail store has a preferred customer plan where customers may earn discounts on all their purchases. The amount of a customers

IN C++ PLEASE: 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 the previous problem ( which is from 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. Create a modified enterNCustomers(int n)function that asks to enter n number customers. All the customer fields must be filled in, and the result of the function is a vector containing n PreferredCustomer objects. You have the same options of text file or user input as the previous problem. Just like the previous problem, create another function that displays all the customer information to the console. Input Validation: Do not accept negative values for any sales figures.

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

5. Check on your expectations:

Answered: 1 week ago