Share
Explore BrainMass

Java class named Person with fields for holding a person's name

Design a Java 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 6 digit customer number and a boolean field indicating whether the customer wishes to be on a mailing list.
Write one or more constructors and the appropriate mutator and accessor methods for the class's fields.
Then, design a class named PreferredCustomer, which extends the Customer class. The PreferredCustomer class should have fields for the amount of the customer's purchases and the customer's discount level.
Write one or more constructors and the appropriate mutator and accessor methods for the class's fields.

Discount levels:
Customer Spends Discount on all future Purchases
$500 5%
$1000 6%
$1500 7%
$2000 10%

Demonstrate instances of each class and tests of all control paths in a program.

Solution Summary

The expert designs a Java class named Person with fields for holding a person's name.

$2.19