Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PersonData and CustomerData classes Design a class named PersonData with the following member variables: lastName firstName address city state zip phone Write the appropriate accessor
PersonData and CustomerData classes
Design a class named PersonData with the following member variables:
lastName
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 customerNumber 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 mailing list. Write appropriate accessor and mutator functions for these member variables.
Demonstrate an object of the CustomerData class in a simple program.
Gaddis T Programming Challengers. PreferredCustomer Class, Chapter p
PreferredCustomer Class
A retail store has a preferred customer plan where customers may earn discounts on alltheir purchases. The amount of a customers discount is determined by the amount of he customers cumulative purchases in the store.
When a preferred customer spends $ he or she gets a discount on all futurepurchases.
When a preferred customer spends $ he or she gets a discount on all future purchases.
When a preferred customer spends $ he or she gets a discount on all future purchases.
When a preferred customer spends $ or more, he or she gets a discounton all future purchases.
Design a class named PreferredCustomer which is derived from the CustomerData class you created in Programming Challenge 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.
Design a class named PersonData that holds two attributes:
Declare one attribute named name of PersonInfo data type.
Declare one attribute named address of MyString data type.
Declare one attribute named city of MyString data type.
Declare one attribute named state of MyString data type.
Declare one attribute named zip of MyString data type.
Declare one attribute named phone of PhoneNumeber data type.
Design a class named CustomerData which is derived from the PersonData class that holds two attributes:
Declare one attribute named customerNumber of integer data type.
Declare one attribute named mailingList of bool data type.
Design a class named PreferredCustomer which is derived from the CustomerData class that holds two attributes:
Declare one attribute named purchasesAmount of floatingpoint data type.
Declare one attribute named discountLevel of floatingpoint data type.
Implement Constructors, Destructor, Copy Constructor, mutators, and accessor functions in your code C
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started