Question: Need help with this java project. Not sure how to start 1. Design a Fan class that represents a simple window fan. This class contains:
1. Design a Fan class that represents a simple window fan. This class contains: Three public static constants ("final" variables) named SLOW, MEDIUM, and FAST with the values 1, 2, and 3, respectively. a. b. int data field named "speed" that specifies the fan speed (the Aprivate default is SLOW) Aprivate boolean data field named "on" that specifies whether the fan is currently on (the default value is false) c. d. Aprivate double data field named "radius" that specifies the radius of the fan (the default value is 5) String data field named "color" that specifies the color of the Aprivate fan (the default value is "blue") e. f. Accessor and mutator methods ("getters" and "setters") for all four data fields A constructor that does not take any arguments, and creates a fan with all default values h. A public method named tostring() that does not take any arguments and returns a String with a description of the fan. If the fan is on, the method returns the fan speed, color, and radius as one combined String. If the fan is off, the method returns the fan color, radius, and the String "fan is off" as one combined String. Draw a UML class diagram for this class and then implement it. Write a test program that creates two Fan objects. Set the first fan's speed to maximum, its radius to 10, and its color to yellow, and then turn it on. Set the second fan's speed to medium, its radius to 5, and its color to blue, then turn it off. Display the objects by invoking their tostring) methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
