[SOLVED] SOLVED:Candle

20.99 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

rar file icon candle.rar (1.3 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

Design the following programs in Java. Prepare your submission by filling in the submission template.From your book CH 10 Exercise 2

Mick’s Wicks makes candles in various sizes. Create a class for the business named

Candle that contains data fields for color, height, and price. Create get methods for

all three fields. Create set methods for color and height, but not for price. Instead,

when height is set, determine the price as $2 per inch. Create a child class named

ScentedCandle that contains an additional data field named scent and methods to

get and set it. In the child class, override the parent’s setHeight() method to set the

price of a ScentedCandle object at $3 per inch. Write an application that instantiates

an object of each type and displays the details. Save the files as Candle.java,ScentedCandle.java, and DemoCandles.java.

  • candle.rar