Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Week 1 1 Program Create a Person, Customer and PreferredCustomer classes. Design a Class named Person with fields for holding a person's name, address (
Week Program
Create a Person, Customer and PreferredCustomer classes.
Design a Class named Person with fields for holding a person's name, address including street, city,
state, and Zip XXXXXYYYY and telephone number. Write at least two Constructors, Assessor and
Mutator methods for all data elements. Add toString to output person information.
Create a Customer, which extends the Person Class. The Customer class should have fields for a
Customer number and a Boolean field indication whether the customer wishes to be on a mailing list.
Write at least two Constructors, Assessor and Mutator methods for all data elements. Add toString to
output Customer information.
UML
Create PreferredCustomer Class, which extends the Customer class. The class should have fields for the
amount of the customer's purchases and the customer's discount level. Write at least two Constructors,
Assessor and Mutator methods for all data elements. Add toString to output PreferredCustomer
information.
The amount of a customer's discount is determined by the following table:
Create an OutofBoundsExceptionClass to handle trying to write data to a full array.
Create a Driver class using array of type Person,
if the person is a Customer add customer number and set mailing list flag.
If the person is a PreferredCustomer set customer number and set mailing list flag.
Create a methods for
Menu
Add a person,
Add a Customer,
Add a PreferredCustomer,
FindAPerson,
Output all
UML
Create a Purchase Using Items below or add your own.
If Person or Customer don't use discount
If PreferredCustomer update purchase amountUse discount
Output Receipt using your local tax rate.
SAMPLE RUN
: Add Person
: Add Customer
: Add Preferred Customer
: Find Contact
: Display All contact
: Create a Purchase
: Exit program
Please enter Person's Name
Joe Smith
Please enter Person's Phone Number
Please enter street address
State St
Please enter City
Nashville
Please enter State
TN
Please enter ZipCode
: Add Person
: Add Customer
: Add Preferred Customer
: Find Contact
: Display All contact
: Create a Purchase
: Exit program
Please enter Person's Name
Jane Doe
Please enter Person's Phone Number
Please enter street address
th St
Please enter City
Plainville
Please enter State
Please enter ZipCode
Please enter Customer Number
Would you like to be on Mailing list? Yes
Yes
: Add Person
: Add Customer
: Add Preferred Customer
: Find Contact
: Display All contact
: Create a Purchase
: Exit program
Please enter Person's Name
Sam Jones
Please enter Person's Phone Number
Please enter street address
th St
Please enter City
Albany
Please enter State
NY
Please enter ZipCode
Please enter Customer Number
Would you like to be on Mailing list? Yes
What is the total of latest purchase:
: Add Person
: Add Customer
: Add Preferred Customer
: Find Contact
: Display All contact
: Create a Purchase
: Exit program
Joe Smith
State St
Nashville, TN
Customer Number:
Customer is on our mailing list
Jane Doe
th St
Plainville, OH
Customer Number:
Customer is on our mailing list
Sam Jones
th St
Albany, NY
The total purchase amount
The Current Discount rate :
: Add Person
: Add Customer
: Add Preferred Customer
: Find Contact
: Display All contact
: Create a Purchase
: Exit program
Please enter Person's Name
Jane Doe
Customer Number:
Customer is on our mailing list
Jane Doe
th St
Plainville, OH
: Add Person
: Add Customer
: Add Preferred Customer
: Find Contact
: Display All contact
: Create a Purchase
: Exit program
Please enter Person's Name
Sam Jones
Please enter Item number
Please enter Description
Oven
Please enter Item Price
Customer id :
Customer is on Mailing list
Sam Jones
Current discount is
Oven $
Taxes :
Total : $
: Add Person
: Add Customer
: Add Preferred Customer
: Find Contact
: Display All contact
: Create a Purchase
: Exit program
Ending program
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