Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

7. Where Do We Begin?

Answered: 1 week ago