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.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public class ScentedCandle extends Candle{
String scent ;
public ScentedCandle() {
super();
}
public String getScent() {
return scent;
}
public void setScent(String scent) {
this.scent = scent;
}
Please let us know the date by which you need help from your tutor or the date and time you wish to have an online tutoring session.
Request Speed
Normal response time: Our most experienced, most successful tutors are provided for maximum expertise and reliability.
Fast response time: Used only for emergencies when speed is the single most important factor.
Why do we ask for this?
We require your email address so that we can send you an email alert when the tutor responds to your message.
We respect your privacy. Your email address will not be used for any other purpose.
You may read our privacy policy for more info.
Please use a personal email address
Please use an email address that does not end in .edu.
This is not a free service
You will get a negotiable price quote with no obligation.
Homework Due Date
Please let us know the date by which you need help from your tutor or the date and time you wish to have an online tutoring session.
Request Speed
Normal response time: Our most experienced, most successful tutors are provided for maximum expertise and reliability.
Fast response time: Used only for emergencies when speed is the single most important factor.
Why do we ask for this?
We require your email address so that we can send you an email alert when the tutor responds to your message.
We respect your privacy. Your email address will not be used for any other purpose.
You may read our privacy policy for more info.
This is not a free service
You will get a negotiable price quote with no obligation.
Homework Library
Warning: If you try using the HL in an unethical manner, expect to fail your class. All HL items are old, recycled materials and are therefore not original. We intend them to be used only for the purpose of studying and learning.