Question: A retail store has a preferred customer plan where customers can earn discounts on all their purchases.. The amount of a customers discount is determined

A retail store has a preferred customer plan where customers can earn discounts on all their purchases.. The amount of a customers discount is determined by the amount of the customers cumulative purchases in the store as follows::

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

When a preferred customer spends $1,000, he or she gets a 6 percent discount on all future purchases.

When a preferred customer spends $1,500, he or she gets a 7 percent discount on all future purchases.

When a preferred customer spends $2,000 or more, he or she gets a 10 percent discount on all future purchases.

Problem Statement

Develop a PreferredCustomer .jjava class and write a test - driver program ( preferredCustomer Driver..jjava ) to test the class . Your implementation must meet the following design requirements..

Design Requirements

Begin by designing a class named Person withfields for holding a persons name,, address,, and telephone number.. Write one or more constructors and the appropriate mutator and accessor methods for the classs fields..

Next,, design a class named Customer , which extends the Person class.. The Customer class should have a field for a customer number and a Boolean field indicating whether the customer wishes to be on a mailing list.. Write one or more constructors and the ap propriate mutator and accessor methods for the classs fields..

The n,, design the PreferredCustomer c lass which extends the C ustomer class . The PreferredCustomer class should have fields for the amount of the customers purchases and the customers discount lev el.. Write one or more construc tors and the appropriat e mutator and accessor methods for the classs fields..

write a test - driver program , PreferredC ustomer Driver..jjava , to demonstrate the class.. The test - driver

Program Input

The test - drive r program obtains its data from a data file ( customer s..ttxt ) with data organized as follows.. Each line in the input file represents a preferred customer . Therefore,, each line consists of the following data values separated by semicolon s : customer name,, customer address,, customer phone number,, customer id,, a Boolean value (ttrue//ffalse)) , and a customer s purchases amount . Here are the first few lines in a sample input file::

Julie James; 123 Main Street , Allentown, NJ 44489; 567 - 555 - 1212; 147 - A049; true ; 1750.00

James Bryant; 567 Main Street , Allentown, NJ 44489; 789 - 555 - 8789; 147 - A078; false ; 2000.00

Program Output

The test - driver program displays the customer name as well as the customer s discount level. In addition, the program should generate two lists for interested customer. The first list is a mailing list consisting of

the customer address and phone number formatted in the usual format .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!