Design a class named person with fields for holding a


Design a class named Person with fields for holding a person's name , address, and telephone number (all as Strings ).

Write a constructor that initializes all of these values, and mutator and accessor methods for every field. Next, design a class named Customer, which inherits from the Person class.

The Customer class should have a String field for the customer number and a boolean field indicating whether the customer wishes to be on a mailing list.

Write a constructor that initializes these values and the appropriate mutator and accessor methods for the class 's fields.

Demonstrate the Customer class in a program that prompts the user to enter values for the customer's name, address, phone number, and customer number, and then asks the user whether or not the customer wants to recieve mail. Use this information to create a customer object and then print its information.

Put all of your classes in the same file. To do this, do not declare them public. Instead, simply write: class Person { ... } class Customer { ... } SAMPLE RUN #1: java Driver Interactive Session Standard Input Standard Error (empty) Standard Output Hide Invisibles Highlight: NoneStandard Input OnlyPrompts OnlyStandard Output w/o PromptsFull Standard OutputAllShow Highlighted Only Enter·name·of·customer:Julia·Stevens? Enter·address·of·customer:77·Massachusetts·Ave·Cambridge,·MA·02139? Enter·phone·number·of·customer:617-777-7777? Enter·customer·number:928734502? Enter·yes/no·--·does·the·customer·want·to·recieve·mail?:no? ? Customer:·? Name:·Julia·Stevens? Address:·77·Massachusetts·Ave·Cambridge,·MA·02139? Phone·Number:·617-777-7777? Customer·Number:·928734502? Recieve·

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Design a class named person with fields for holding a
Reference No:- TGS01528649

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)