Write a class named Fan to model fans. The properties are speed, on, radius, and
ID: 645474 • Letter: W
Question
Write a class named Fan to model fans. The properties are speed, on, radius, and color. You need to provide the accessor methods for the properties, and the toString method for returning a string consisting of all the string values of all the properties in this class. Suppose the fan has three fixed speeds. Use constants 1, 2, and 3 to denote slow, medium, and fast speeds.
The outline of the class is given as follows:
public class Fan {
public final int SLOW = 1;
public final int MEDIUM = 2;
public final int FAST = 3;
private int speed = SLOW;
private boolean on = false;
private double radius = 5;
private String color =
Explanation / Answer
Hope it may helps you...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.