(The Fan class) Design a class named Fan to represent a fan. The class contains:
■ An int data field named speed that specifies the speed of the fan. A fan has three speeds indicated with a value 1 , 2 , or 3.
■ A bool data field named on that specifies whether the fan is on.
■ A double data field named radius that specifies the radius of the fan.
■ A no-arg constructor that creates a default fan with speed 1 , on false , and radius 5.
■ The accessor and mutator functions for all the data fields.
Draw the UML diagram for the class. Implement the class. Write a test program that creates two Fan objects. Assign speed 3 , radius 10 , and turn it on to the first object. Assign speed 2 , radius 5 , and turn it off to the second object. Invoke their accessor functions to display the fan properties.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.