This is a C++ program
Instructions
Design a class named PersonData with the following member variables declared as strings:
Create 3 constructors; a default constructor, a constructor that accepts the first and last name member variables, and a constructor that accepts all member variables. Write the appropriate accessor/getter and mutator/setter functions for these member variables. Create a method within this class called getFullName() that returns the person's first and last names as a single string.
Next, design a class named CustomerData, which is derived from the PersonData class. The CustomerData class should have the following member variables:
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. There should be a default constructor, a constructor that accepts first and last name along with the member variables of the CustomerData class, and a constructor that accepts all of the member variables in both classes. Write appropriate accessor and mutator functions for these member variables.
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
Design a class named PreferredCustomer, which is derived from the CustomerData class you just created. The PreferredCustomer class should have the following member variables:
The purchasesAmount variable holds the total of a customer’s purchases to date. The discountLevel member variable should be set to the correct discount percentage, according to the store’s preferred customer plan. Therefore, there should not be a standard setter for this member variable. Instead, write a member function/method called calculateDiscount() that when called, will receive the new sale and evaluate the purchasesAmount member variable with that sale to set the discount level. This method should also return the calculated discount. There should also be an addSale() method that receives a sale amount and accumulates/adds it the the purchasesAmount member variable. Write appropriate member functions and constructors for this class. (Remember to reference to two overloaded constructors written in the parent class. These constructors should not receive the purchases and discount level as parameters as they will be set from other functionalities.)
Input Validation: Do not accept negative values for any sales figures.
Create Driver Program
Create a program called Customer Sales Entry that contains the following requirements:
Sample Output – (Bold/Red is user input. Also, your output (excluding customer data) must match the output below.)
Customer Sales Entry
--------------------------
Customer first and last name: John Doe
Street Address: 123 Main Street
City: Aur
State: CO
Zip: 00000
Phone: 303-555-0000
Would the customer like to be on our mailing list (Y or N): n
Type 1 to enter sale or 2 to exit: 1
Enter amount of sale: 276.25
Customer Sales Information
----------------------------------
Customer Number: 1000
John Doe
123 Main Street
Aur, CO 00000
Phone: 303-766-0000
Original Sale Amount: $276.25
Customer Discount: 0.00%
Discounted Sale: $276.25
Total Purchases: $276.25
Type 1 to enter sale or 2 to exit: 1
Enter amount of sale: 525.46
Customer Sales Information
----------------------------------
Customer Number: 1000
John Doe
123 Main Street
Aur, CO 00000
Phone: 303-766-0000
Original Sale Amount: $525.46
Customer Discount: 5.00%
Discounted Sale: $499.19
Total Purchases: $801.71
Type 1 to enter sale or 2 to exit: 1
This customer is not on our mailing list!
Would the customer like to be added to our mailing list (Y or N): y
Customer has been added to our mailing list.
The program will now exit!
Note : I have some doubt regarding the main() function. Do i need to read any input from the input file...?
___________________________
#include <iostream>
#include <iomanip>
using namespace std;
class Person
{
private :
string lastname;
string firstname;
string address;
string city;
string state;
string zip;
string phone;
public :
Person( string lastname,
string firstname,
string address,
string city,
string state,
string zip,string phone)
{
this->lastname=lastname;
this->firstname=firstname;
this->address=address;
this->city=city;
this->state=state;
this->zip=zip;
this->phone=phone;
}
};
class Customer:public Person
{
private :
int customerNumber;
bool mailingList;
string comments;
public :
Customer()
{
this->customerNumber=0;
this->mailingList=false;
this->comments="XXXXXXXX";
}
Customer(string lastname,
string firstname,
string address,
string city,
string state,
string zip,string phone,int customerNumber,
bool mailingList,
string comments):Person(lastname,firstname,address,city,state,zip,phone)
{
this->customerNumber=comments;
this->mailingList=mailingList;
this->comments=comments;
}
}};
class PreferredCustomer:public Customer
{
private :
double purchases;
int discountLevel;
public :
PreferredCustomer(string lastname,
string firstname,
string address,
string city,
string state,
string zip,string phone,int customerNumber,
bool mailingList,
string comments,double purchases):Customer(lastname,
firstname,
address,
city,
state,
zip,phone,customerNumber,
mailingList,
comments)
{
this->purchases=purchases;
if(purchases>500)
this->discountLevel=5;
else if(purchases>1000)
this->discountLevel=6;
else if(purchases>1500)
this->discountLevel=7;
else if(purchases>2000)
this->discountLevel=10;
}
PreferredCustomer()
{
this->purchases=0;
this->discountLevel=0;
}
};
int main()
{
PreferredCustomer pc1()
return 0;
}
______________________________
This is a C++ program Instructions Design a class named PersonData with the following member variables...
7. 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 customer Number variable will be used to hold a unique integer for each customer. The mailing List variable should be a bool....
7. 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....
Design a class for python 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...
This must be written in C# with overloaded constructors and member initialization list 4. Person and Customer Classes Design a class named Person with properties for holding a person's name, address, and telephone number. Next, design a class named Customer, which is derived from the Person class. The Customer class should have a property for a customer number and a Boolean property indicating whether the customer wishes to be on a mailing list. Demonstrate an object of the Customer class...
this is java m. please use netbeans if you can.
7. Person and Customer Classes Design a class named Person with fields for holding a person's name, address, and telephone number. Write one or more constructors and the appropriate mutator and accessor methods for the class's fields. Next, design a class named Customer, which extends the Person class. The Customer class should have a field for a customer number and a boolean field indicating whether the cus- tomer wishes to...
Please use Java Question 3: Person and Customer classes: Design a class named Person with properties for holding a person's name, address, and telephone number. Next, design a class named Customer, which is derived from the Person class. The Customer class should have a property for a customer number and a Boolean property indicating whether wishes to be on a mailing list. Demonstrate an object of customer class in a simple GUI application. Write the code include appropriate input validation,...
Assignment 6 Due: Apr 12, 2019 at 11:59 PM A6 OOP 3 "PreferredCustomer Class" (need to create Person, Customer classes described in the previous problem) Access A6 from pdf assignment file. Turn in the following files: a6main.java Customer.java Person.java PreferredCustomer.java program compile and run screenshots design document (including UML) A6 7. Person and Customer Classes esign a class named Person with fields for holding a person's name, address, and telephone number. Write one or more constructors and the appropriate mutator...
Design a class named Person with fields for holding a person's name, address, and telephone number (all as Strings). Write a constructor that initializes all of these values, and mutator and accessor methods for every field. Next, design a class named Customer, which inherits from the Person class. The Customer class should have a String field for the customer number and a boolean field indicating whether the customer wishes to be on a mailing list. Write a constructor that initializes...
Using C++, Write a class named Employee that has the following member variables: name. A string that holds the employee's name. idNumber. An int variable that holds the employee's ID number. department. A string that holds the name of the department where the employee works. position. A string that holds the employee's job title. The class should have the following constructors: A constructor that accepts the following values as arguments and assigns them to the appropriate member variables: employee's name,...
Write a C++ program Write a class named Employee that has the following member variables: name A string that holds the employee name idNumber An int to hold employee id number department A string to hold the name of the department position A string to hold the job position The class will have three constructors: 1. A constructor that accepts all the internal data such as: Employee susan("Susan Meyers", 47899, "Accounting", "Vice President"); 2. A constructor that accepts some of...