Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote