Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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·

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91900800
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

You run a small pizza shop named pizza hat initially you

You run a small pizza shop named Pizza Hat. Initially you sold pizzas for $8 and every week you sold around 3000 pizzas. Each pizza costs you $3 to make. One day you decided to o¤er discounts to customers to see if you c ...

Recall that a k-ary tree is a rooted tree where each node

Recall that a k-ary tree is a rooted tree where each node has up to k children (for some positive integer k). (a) Write a recursive definition of a nonempty A-ary tree with height h greaterthanorequalto 0. (b) A complete ...

1 what would be the purpose for a user to protect a

1. What would be the purpose for a user to protect a file from "read" or "write" access by other users? 2. Is there a reason why it would be safer for administrators to use two different accounts when working with a comp ...

Briefly explain what separations are how do they effect the

Briefly explain what separations are, how do they effect the average duration of unemployment?

In a competitive market the market demand is qd 60- 6p and

In a competitive market, the market demand is Qd= 60- 6P and the market supply is the Qs= 4P the full economic price under a price ceiling of $3 is:?

Question the below table shows the instruction count ic for

Question : The below table shows the instruction count (IC) for programs running on three processors P1, P2, and P3 with the clock rates 1.0 GHz, 2.5 GHZ, and 2.0 GHz respectively. Each program consists of only Load/stor ...

The contracts manager at a company needs to make a large

The contracts manager at a company needs to make a large legal document available to an overseas customer. However, she has some challenges: The document contains sensitive information; it is too large to send via e-mail ...

Solution must be recursive you are not allowed to use loops

Solution must be recursive. You are not allowed to use loops, or use the Python "in" operator. PYTHON Write a function called first. It is passed a parameter x, that may or may not be a list; if is x is a list it may con ...

Scenario pit powerpit owns a small bike shop feelwheel that

SCENARIO: PIT POWER Pit owns a small bike shop FeelWheel that sells only customized bikes. These days, many customers inherit their bikes from their grandparents or buy them in hardware stores. Thus, it does not make muc ...

Problem belowwrite a program that uses a function that

Problem below: Write a program that uses a function that returns a number between 1 and 6. Use this function to simulate the roll of a die. Allow the user to specify the number of trials and then tabulate that number of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As