Question: 2. Write a class Fan that has the following instance variables Exercise 1 Speed (an integer indicating the speed in r.p.m or Revolutions per minute,

 2. Write a class Fan that has the following instance variables
Exercise 1 Speed (an integer indicating the speed in r.p.m or Revolutions

2. Write a class Fan that has the following instance variables Exercise 1 Speed (an integer indicating the speed in r.p.m or Revolutions per minute, with a default value of O) Exercise 2 .f on (a boolean variable that indicates if the fan is ON or OFF. 'true indicates Exercise 4 Exercise 5 Exercise 6 Exercise 7 ks that the fan is ON, 'false' indicates otherwise. Default should be 'false') Radius (a variable of type double specifying the radius of the fan, with a default value of 4.0) Color (a String variable indicating the color of the fan, with a default value of BLUE" Add a default constructor that should set the instance variables to their respective default values. Add a second constructor that sets the variables as per your choice. Then add a method display) that displays the details of a fan object and its state in the following format: RADIUSof the fan is ON) If the fan is OFF) FAN STATE COLOR RADIUS where, FAN STATE is either ON or OFF least one object of each state (ON and OFF) in the tester class Write a class Right Triangle that has the following instance variables: FanTester to test the above method and constructors. You should create at

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!