- (The Fan class) Design a class named Fan to represent a fan. The class contains:

1. Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote the fan speed.

2. An int data field named speed that specifies the speed of the fan (default SLOW).

3. A boolean data field named on that specifies whether the fan is on (default false).

4. A double data field named radius that specifies the radius of the fan (default 5).

5. A string data field named color that specifies the color of the fan (default blue).

6. A no-arg constructor that creates a default fan.

7. The accessor and mutator methods for all four data fields.

8. A method named toString() that returns a string description for the fan. If the fan is on, the method returns the fan speed, color, and radius in one combined string. If the fan is not on, the method returns fan color and radius along with the string "fan is off" in one combined string.

Draw the UML diagram for the class. Implement the class. Write a test program that creates two Fan objects. Assign maximum speed, radius 10, color yellow, and turn it on to the first object. Assign medium speed, radius 5, color blue, and turn it off to the second object. Display the objects by invoking their toString method.

plz help me......... by using the eclips software

ajst commented: lack of effort +0

You need to post some code, all you have done is posted your hw problem.

Jamesonh20

First create a class name Fan.The class contains:
Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote the fan speed.
An int data field named speed that specifies the speed of the fan (default SLOW).
A boolean data field named on that specifies whether the fan is on (default false).
A double data field named radius that specifies the radius of the fan (default 5).
A string data field named color that specifies the color of the fan (default blue).
A no-arg constructor that creates a default fan.
The accessor and mutator methods for all four data fields. (get and set methods for all your variables)
A method named toString() that returns a string description for the fan. If the fan is on, the method returns the fan speed, color, and radius in one combined string. If the fan is not on, the method returns fan color and radius along with the string "fan is off" in one combined string.

The only help we can give you is the above. Because that description tells you exactly what you need to do. You don't have to think anything. It is not like you have been told to create a Fan class and you had to think the rest for yourself.
You have been given everything you need to code this. Just do exactly what the instructions tells you to do.

If you don't know how to create a class or how to declare variables and methods, then our job is not to replace your teacher. Your book or notes should answer those questions. Just study them

i have same this question ....how to draw design java on this question.... can you give me answer the this question ....how the coding and the output attached with the cover.

i have same this question ....how to draw design java on this question.... can you give me answer the this question ....how the coding and the output attached with the cover.

Start a new thread, and post your question there. What you say doesn't make sense. Explain your problem better. And also post some code if you have any

This my Question :

1. Draw the UML class diagram
2. implement the class with proper visibility modifier, accessor and mutator
3. write the test program.


(The Fan class) Design a class named Fan to represent a fan. The class contains:

- Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote the fan speed.

- An int data field named speed that specifies the speed of the fan (default SLOW).

- A boolean data field named on that specifies whether the fan is on (default false).

- A double data field named radius that specifies the radius of the fan (default 5).

- A string data field named color that specifies the color of the fan (default blue).

- A no-arg constructor that creates a default fan.

- The accessor and mutator methods for all four data fields.

- A method named toString() that returns a string description for the fan. If the fan is on, the method returns the fan speed, color, and radius in one combined string. If the fan is not on, the method returns fan color and radius along with the string "fan is off" in one combined string.

Draw the UML diagram for the class. Implement the class. Write a test program that creates two Fan objects. Assign maximum speed, radius 10, color yellow, and turn it on to the first object. Assign medium speed, radius 5, color blue, and turn it off to the second object. Display the objects by invoking their toString method.


i do not know how do it .....plez help me.....

This my Question :

1. Draw the UML class diagram
2. implement the class with proper visibility modifier, accessor and mutator
3. write the test program.


(The Fan class) Design a class named Fan to represent a fan. The class contains:

- Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote the fan speed.

- An int data field named speed that specifies the speed of the fan (default SLOW).

- A boolean data field named on that specifies whether the fan is on (default false).

- A double data field named radius that specifies the radius of the fan (default 5).

- A string data field named color that specifies the color of the fan (default blue).

- A no-arg constructor that creates a default fan.

- The accessor and mutator methods for all four data fields.

- A method named toString() that returns a string description for the fan. If the fan is on, the method returns the fan speed, color, and radius in one combined string. If the fan is not on, the method returns fan color and radius along with the string "fan is off" in one combined string.

Draw the UML diagram for the class. Implement the class. Write a test program that creates two Fan objects. Assign maximum speed, radius 10, color yellow, and turn it on to the first object. Assign medium speed, radius 5, color blue, and turn it off to the second object. Display the objects by invoking their toString method.


i do not know how do it .....plez help me.....

Start a new thread.
Also the exercise tells you exactly what you need.

The class contains:
- Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote the fan speed.

These are instructions! Everything has been given to you. Just follow those instructions. They tell you what your class needs to have.

Now if you don't know how to create a simple class( create a file and name it Fan and write lines inside it), then don't expect someone to give you the code.
Do some studying. You should have notes on how to create the above. And the exercise's description tells you exactly what you need to write.

And start a new thread

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.