Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

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, error and exception handling code.

A retail store has a preferred customer plan where customers can earn discounts on all their purchases. The amount of discount depends on customer's cumulative purchases in the store and the business rules for discounts is as follows:

When a preferred customer spends $500, he or she gets a 5 % discount on all future purchases.

When a preferred customer spends $1000, he or she gets a 6 % discount on all future purchases.

When a preferred customer spends $1500, he or she gets a 7 % discount on all future purchases.

When a preferred customer spends $2000, he or she gets a 10 % discount on all future purchases.

Design a class called PreferredCustomer, which is derived from the Customer class you created in No 3.

The PreferredCustomer class should have properties for the amount of the customer's purchases and the customer's discount level. Demonstrate the class in a simple GUI application.

Write the code include appropriate input validation, error and exception handling code.

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

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

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

3. List ways to manage relationship dynamics

Answered: 1 week ago