Design a class named fan to represent a fan - a private


Design a class named Fan to represent a fan. The class contains:

Three constants named SLOW, MEDIUM, and FAST with the values 1, 2, and 3 to
denote the fan speed.
A private int data field named speed that specifies the speed of the fan (the
default is SLOW).
A private boolean data field named onOff that specifies whether the fan is on (the
default is false).
A private double data field named radius that specifies the radius of the fan
(the default is 5).
A string data field named color that specifies the color of the fan (the default
is blue).
A no-arg constructor that creates a default fan.
A method named ToString() that outputs a description for the fan. If the fan is on, the method prints the fan speed, color, and radius . If the fan is not on, the method prints the fan color and radius along with the string "fan is off" .
Draw the UML diagram for the class and then implement the class. Write a test program that creates two Fan objects. For the first fan, assign fast speed, radius 10, color yellow, and turn it on. For the second fan, assign medium speed, radius 5, color blue, and turn it off. Invoke the toString methods of each object. Create screenshots of the outputs of the toStringmethods.
Note: Ways to draw UMLs -> Draw.io (Recommended)
Other applications ->UMLet; UML Designer; Applications in Eclipse Marketplace
Homework Submissions & Assessment
Your submission should include:
The java source code file
The UML diagrams
Pseudo code showing the design of the class logic
The screen captures/console output of the toString outputs.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Design a class named fan to represent a fan - a private
Reference No:- TGS02382866

Now Priced at $15 (50% Discount)

Recommended (94%)

Rated (4.6/5)