Answered step by step
Verified Expert Solution
Link Copied!

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 11 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 XXXXX-YYYY), 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
1: Add Person
2: Add Customer
3: Add Preferred Customer
4: Find Contact
5: Display All contact
6: Create a Purchase
7: Exit program
1
Please enter Person's Name
Joe Smith
Please enter Person's Phone Number
111-111-1111
Please enter street address
11 State St.
Please enter City
Nashville
Please enter State
TN
Please enter ZipCode
11111
1: Add Person
2: Add Customer
3: Add Preferred Customer
4: Find Contact
5: Display All contact
6: Create a Purchase
7: Exit program
2
Please enter Person's Name
Jane Doe
Please enter Person's Phone Number
222-222-2222
Please enter street address
225th St
Please enter City
Plainville
Please enter State
OH
Please enter ZipCode
22222
Please enter Customer Number
11111
Would you like to be on Mailing list? (Yes)
Yes
1: Add Person
2: Add Customer
3: Add Preferred Customer
4: Find Contact
5: Display All contact
6: Create a Purchase
7: Exit program
3
Please enter Person's Name
Sam Jones
Please enter Person's Phone Number
333-333-3333
Please enter street address
444th St.
Please enter City
Albany
Please enter State
NY
Please enter ZipCode
44444
Please enter Customer Number
22222
Would you like to be on Mailing list? (Yes)
What is the total of latest purchase:
1400
1: Add Person
2: Add Customer
3: Add Preferred Customer
4: Find Contact
5: Display All contact
6: Create a Purchase
7: Exit program
5
Joe Smith
111-111-1111
11 State St.
Nashville, TN 11111
Customer Number: 11111
Customer is on our mailing list
Jane Doe
222-222-2222
225th St
Plainville, OH 22222
Customer Number: 22222
Customer is on our mailing list
Sam Jones
333-333-3333
444th St.
Albany, NY 44444
The total purchase amount =1400.00
The Current Discount rate : ,6.0%
1: Add Person
2: Add Customer
3: Add Preferred Customer
4: Find Contact
5: Display All contact
6: Create a Purchase
7: Exit program
4
Please enter Person's Name
Jane Doe
Customer Number: 11111
Customer is on our mailing list
Jane Doe
222-222-2222
225th St
Plainville, OH 22222
1: Add Person
2: Add Customer
3: Add Preferred Customer
4: Find Contact
5: Display All contact
6: Create a Purchase
7: Exit program
6
Please enter Person's Name
Sam Jones
Please enter Item number
115
Please enter Description
Oven
Please enter Item Price
999.00
Customer id :22222
Customer is on Mailing list
Sam Jones
Current discount is 0.10
115 Oven $899.10
Taxes : ,88.11
Total : ,$987.21
1: Add Person
2: Add Customer
3: Add Preferred Customer
4: Find Contact
5: Display All contact
6: Create a Purchase
7: Exit program
7
Ending program
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions