Mutator and accessor methods for the class fields


Discuss the below:

Design a Java class named Person with fields for holding a person's name, address and telephone number.

Create 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 Preview :

Prepared by a verified Expert
JAVA Programming: Mutator and accessor methods for the class fields
Reference No:- TGS01934731

Now Priced at $25 (50% Discount)

Recommended (99%)

Rated (4.3/5)