Results 1 to 6 of 6
- 04-19-2008, 09:54 PM #1
Member
- Join Date
- Apr 2008
- Posts
- 3
- Rep Power
- 0
Pls HeLp Me (Design a class named Fan)
pleeeaaase i need the solve at near time
(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.
-
Try to develop the class yourself and ask us what is the problem you can not solve. You should have basic understanding of Java. If not try reading starting sections of Sun's Java tutorial.
"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
- 04-20-2008, 01:59 AM #3
Member
- Join Date
- Apr 2008
- Posts
- 28
- Rep Power
- 0
LOLZ, no doute you didn't know how.
- 04-20-2008, 01:19 PM #4
That is why he asked....LOLZ, no doute you didn't know how.
regards,
sukatoa
- 04-20-2008, 07:57 PM #5
Member
- Join Date
- Apr 2008
- Posts
- 3
- Rep Power
- 0
Thanks For All
- 04-21-2008, 07:25 PM #6
Listen to what JavaTip said. Keep something mind as you learn Java- what you've just posted here is VERY specific, you will need to learn how to translate specification into results on your own. Start small and then come back here with some results.
Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice? Vote now!
Got a little Capt'n in you? (drink responsibly)
Similar Threads
-
Design Calendar UI
By praveen.kb in forum AWT / SwingReplies: 0Last Post: 01-21-2008, 11:54 AM -
MappingException: Named query not known :
By abhibh_1 in forum Web FrameworksReplies: 0Last Post: 08-14-2007, 12:59 PM -
Design patterns
By Freddie in forum New To JavaReplies: 2Last Post: 05-12-2007, 06:21 AM -
named pipes
By samson in forum NetworkingReplies: 1Last Post: 04-04-2007, 06:40 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks