Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 17-Dec-12 4:34am
Edited 20-Dec-12 20:58pm
v4
Comments
Richard MacCutchan at 21-Dec-12 5:51am
   
There is no point in editing this question, as no one is going to do this work for you.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yes, you got an assignment so you are expected to do the work.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Comments
jibesh at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 530
1 mhegazy94 460
2 Ravi Bhavnani 230
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,205
1 OriginalGriff 6,801
2 CPallini 5,350
3 George Jonsson 3,644
4 Gihan Liyanage 2,797


Advertise | Privacy | Mobile
Web03 | 2.8.140922.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100