Question: Java Program. Design a class named MicroWave to represent a microwave. The class must contain the following: 1. Three constants named LOW, MEDIUM, HIGH to
Java Program. Design a class named MicroWave to represent a microwave. The class must contain the following:
1. Three constants named LOW, MEDIUM, HIGH to represent possible microwave heat selections.
2. A private int data field named heatSelection that specifies the microwave heat selection(default is MEDIUM)
3. A private boolean data field named ON that specifies whether the microwave is on(default is false)
4. A string data field named color that specifies the color of the microwave.(default color is black)
5. A no-arg constructor that creates a microwave with default values.
6. A constructor that takes all three data fields.
7. Accessor methods for all three data fields.
8. Mutator methods for the heatSelection and on data fields.
9. A toString() method implementation that returns the color and heat selection ("LOW', "MEDIUM", "HIGH" as a text string) of the microwave.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
