Results 1 to 6 of 6
  1. #1
    faw
    faw is offline Member
    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

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

  2. #2
    Java Tip's Avatar
    Java Tip is offline Moderator
    Join Date
    Nov 2007
    Posts
    1,694
    Blog Entries
    430
    Rep Power
    10

    Default

    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.

  3. #3
    fireball2008 is offline Member
    Join Date
    Apr 2008
    Posts
    28
    Rep Power
    0

    Default

    LOLZ, no doute you didn't know how.

  4. #4
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    LOLZ, no doute you didn't know how.
    That is why he asked....

    regards,
    sukatoa

  5. #5
    faw
    faw is offline Member
    Join Date
    Apr 2008
    Posts
    3
    Rep Power
    0

    Default

    Thanks For All

  6. #6
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    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

  1. Design Calendar UI
    By praveen.kb in forum AWT / Swing
    Replies: 0
    Last Post: 01-21-2008, 12:54 PM
  2. MappingException: Named query not known :
    By abhibh_1 in forum Web Frameworks
    Replies: 0
    Last Post: 08-14-2007, 01:59 PM
  3. Design patterns
    By Freddie in forum New To Java
    Replies: 2
    Last Post: 05-12-2007, 07:21 AM
  4. named pipes
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 07:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •