Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Both are in the same problem 7. PersonData and CustomerData Classes Design a class named PersonData with the following member variables: . last Name .

Both are in the same problem

image text in transcribedimage text in transcribed
7. PersonData and CustomerData Classes Design a class named PersonData with the following member variables: . last Name . firstName . address . city . state . zip . phone Write the appropriate accessor and mutator functions for these member variables. Next, design a class named CustomerData, which is derived from the PersonData class. The CustomerData class should have the following member variables: . customerNumber . mailingList The customer Number variable will be used to hold a unique integer for each customer. The mailingList variable should be a bool. It will be set to true if the customer wishes to be on a mailing list, or false if the customer does not wish to be on a mail- ing list. Write appropriate accessor and mutator functions for these member variables. Demonstrate an object of the CustomerData class in a simple program.8. PreferredCustomer Class A retail store has a preferred customer plan where customers may 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. . When a preferred customer spends $500, he or she gets a 5 percent discount on all future purchases. . When a preferred customer spends $1,000, he or she gets a 6 percent discount on all future purchases. . When a preferred customer spends $1,500, he or she gets a 7 percent discount on all future purchases. . When a preferred customer spends $2,000 or more, he or she gets a 10 percent dis- count 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 customer's purchases to date. The discount Level variable should be set to the correct discount percentage, according to the store's 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

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

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Explain how followership is related to effective leadership.

Answered: 1 week ago