Click here to Skip to main content
15,893,904 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello programmers ^^
i 'am new here... so..
i got assignment from my lecture.

• Three static constants named SLOW, MEDIUM, and FAST with the values 1, 2, and 3 to denote the fan speeds.
• A private int data filed named “speed” that specifies the speed of the fan, default to slow.
• A private Boolean data field named “on” that specifies whether the fan is on, default to false.
• A private double data field named “radius” that specifies the radius of the fan, default to 5.
• A private string data field named “color” that specifies the color of the fan, default to “blue”.
• A properties for all 4 data fields.
• A no-argument constructor that creates a default fan.use this ref.
• A one-argument constructor that creates fan. provide speed value.
• A two-argument constructor that creates fan. provide speed and on value.
• A three-argument constructor that creates fan. provide speed , on , and radius value
• A four-argument constructor that creates fan. provide speed , on , radius , and color value.

• A DisplayFan( ) method 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 off, the method returns the fan color and radius along with the string, “fan is off” in one combined string.

The Fan Application class

• Write a test program that creates two Fan objects.
• Fan Object 1 inputs:
o Assign Fastest Speed.
o Assign a radius 10
o Assign the color yellow
o Turn the fan on.
• Fan Object 2 inputs:
o Assign Medium Speed.
o Assign a radius 5
o Assign the color blue
o Turn the fan off.
Posted
Updated 20-Dec-12 20:58pm
v4
Comments
Richard MacCutchan 21-Dec-12 5:51am    
There is no point in editing this question, as no one is going to do this work for you.

Yes, you got an assignment so you are expected to do the work.
 
Share this answer
 
As you said this is your assignment, so it would be best if you did it your self.
It is given to you so that you will learn something, think about what have been taught. Read your text books and give it a try.

Once you have code and run into problems you can always come back here with a more specific question and the community will do its best to help you. Don't forget to post only the relevant code bits that pose the problem as a code dump is not usually helpful at all in getting someone to help/assist you.

Good luck and happy coding.
 
Share this answer
 
Comments
Jibesh 17-Dec-12 14:49pm    
do check yourself and if any error popsup try to solve yourself thats how you learning programming. if you still have trouble with error we are here to help you.
You can use 'Improve Solution' link right bottom of your question to edit your question if you want.
you should compile and run your code and see if it works as the requirements dictate. When you compile it you will get errors (if something went wrong) that will direct you in the right direction. as a beginner you need to practice, get errors fix them and gain experience.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900