Question: please write in Java and include the two classes Design a class named Fan (Fan.java) to represent a fan. The class contains: An int field
Design a class named Fan (Fan.java) to represent a fan. The class contains: An int field named speed that specifies the speed of the fan. A boolean field named fanStatus that specifies whether the fan is on (default false). A double field named radius that specifies the radius of the fan (default 5). A string field named color that specifies the color of the fan (default blue). A no-arg (default) constructor that creates a default fan. A constructor that creates a fan with four parameters: speed, fanStatus, radius, and color. A method named toString() that returns a string description for the fan. The method returns the fan speed, color, radius, and fan status (either on or off) in one combined string. Write a TestFan program that asks the user to enter the fan speed, radius, fan status, and color. The program creates a fan object by using the constructor with four parameters. Then it should display the fan description by invoking their toString() method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
