Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1/Write a test program that does the following: 110 Creates two Fan objects. 1/6 Assigns maximum speed, radius 10, color yellow to the first object.

image text in transcribed
1/Write a test program that does the following: 110 Creates two Fan objects. 1/6 Assigns maximum speed, radius 10, color yellow to the first object. 1/8 Turns first object on. // After first object is turned on, it increases its speed. 1/8 Assigns medium speed, radius 5, color blue to the second object. 1/8 Turns second object on. 1/0 Then decreases its speed twice 1/B After that it turns it off. 1/2 Displays the two objects by invoking their toString() method. \/class Fan // public Fan() () // public int getSpeed() //return 1/} 1/public boolean getOn() //{return 1/public double getRadius() //{return radius;} //public String getColor() //{return color;) 1/public void setSpeed(int speed) // (this. -;} 1/public void setOn(boolean on) {this.on - on;} 1/public void setRadius(double radius) //{this. //public void setColor(String color) 1/ (this.color = color;) 1/public String toString() { // return getOn() ? + radius + inch " + color + " fan at a speed of radius + inch + color + fan; fan is off"; + speed

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

Students also viewed these Databases questions

Question

Describe the functions of communication

Answered: 1 week ago

Question

What is order of reaction? Explain with example?

Answered: 1 week ago

Question

Derive expressions for the rates of forward and reverse reactions?

Answered: 1 week ago