Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-19-2008, 10:54 PM
faw faw is offline
Member
 
Join Date: Apr 2008
Posts: 3
faw is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-19-2008, 11:36 PM
Moderator
 
Join Date: Nov 2007
Posts: 1,637
Java Tip will become famous soon enoughJava Tip will become famous soon enough
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.
__________________
Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums! (closes on July 27, 2008)
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 02:59 AM
Member
 
Join Date: Apr 2008
Posts: 28
fireball2008 is on a distinguished road
Send a message via AIM to fireball2008
LOLZ, no doute you didn't know how.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-20-2008, 02:19 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 524
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Quote:
LOLZ, no doute you didn't know how.
That is why he asked....

regards,
sukatoa
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-20-2008, 08:57 PM
faw faw is offline
Member
 
Join Date: Apr 2008
Posts: 3
faw is on a distinguished road
Thanks For All
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 04-21-2008, 08:25 PM
CaptainMorgan's Avatar
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 839
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adapter design pattern JavaForums Java Blogs 0 03-08-2008 10:00 PM
Design Calendar UI praveen.kb AWT / Swing 0 01-21-2008 12:54 PM
MappingException: Named query not known : abhibh_1 Web Frameworks 0 08-14-2007 01:59 PM
Design patterns Freddie New To Java 2 05-12-2007 07:21 AM
named pipes samson Networking 1 04-04-2007 07:40 AM


All times are GMT +3. The time now is 08:37 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org