Question: Micks Wicks makes candles in various sizes. Create a class for the business named Candle that contains the following data fields: color - of type
Micks Wicks makes candles in various sizes. Create a class for the business named Candle that contains the following data fields: color - of type String height - of type int price - of type double 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 (of type String) and methods to get and set it. In the child class, override the parents setHeight() method to set the price of a ScentedCandle object at $3 per inch.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
