Question: JAVA programming Hello, I need help with this, please. Thanks Assignment: Write a program with a class titled Fan. This class is to contain: Four

JAVA programming

Hello, I need help with this, please. Thanks

Assignment:

Write a program with a class titled Fan. This class is to contain:

Four constants named STOPPED, SLOW, MEDIUM, and FAST. The constants are to hold the values of 0, 1, 2, and 3 respectively.

A private field named speed that holds one of the constant values with the default being STOPPED.

A private Boolean field titled on that specifies whether the fan is on or off.

A private field named radius that holds the radius of the fan with a default value of 6.

A String field that holds the color, with the default being white.

Setter and getter methods for all mutable fields.

A no-argument constructor that sets all fields with a default value.

A constructor taking arguments and setting values.

Write a toString() method that returns a description of the Fans state.

Write test code that creates two instances of the Fan class, one using the default constructor and the other using the argument constructor. Write code that displays the functionality of the Fan class methods.

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!