Results 1 to 13 of 13
Like Tree2Likes
  • 1 Post By Tolls
  • 1 Post By JosAH

Thread: Neeh help in task please

  1. #1
    kumar_ravi is offline Member
    Join Date
    Jul 2012
    Location
    Brisbane, Australia
    Posts
    4
    Rep Power
    0

    Post Neeh help in task please

    Hi all,
    I need to define an abstract base type called Quadrilateral. Derived types Rectangle, Square and Parallelogram are based on this type. i need to write definitions of the public abstract class Quadrilateral along with the classes for the derived types according to fallowing table:


    Quadrilateral : Area = Abstract , toString()=name

    Rectangle: Area = length*width ,toString()=name, perimeter
    Square: Area = length * length, toString()=name, perimeter
    Parallelogram: Area =length * width ,toString()=name, perimeter

    Assume that the derived class name is used as the name and that the length and width are double values.
    Write a test harness that defines a object of each of these types, and prints out the name and area of a sample of each of the types.

    Thanks
    Last edited by kumar_ravi; 07-31-2012 at 06:02 PM.

  2. #2
    awinston is offline Student
    Join Date
    Jul 2012
    Location
    United States
    Posts
    328
    Rep Power
    5

    Default Re: Neeh help in task please

    Do you have a question about how to complete your assignment?
    "Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,071
    Rep Power
    23

    Default Re: Neeh help in task please

    It's nice that people think we're interested in their homework...
    awinston likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,372
    Blog Entries
    7
    Rep Power
    25

    Default Re: Neeh help in task please

    Given those hints and instructions the code almost writes itself.

    kind regards,

    Jos
    awinston likes this.
    The only person who got everything done by Friday was Robinson Crusoe.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,005
    Rep Power
    23

    Default Re: Neeh help in task please

    Almost is as good as a mile...

    db <--- almost ready to write the code
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,372
    Blog Entries
    7
    Rep Power
    25

    Default Re: Neeh help in task please

    Quote Originally Posted by DarrylBurke View Post
    Almost is as good as a mile...

    db <--- almost ready to write the code
    Sorry I'm metric; yo no comprendo.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  7. #7
    awinston is offline Student
    Join Date
    Jul 2012
    Location
    United States
    Posts
    328
    Rep Power
    5

    Default Re: Neeh help in task please

    Quote Originally Posted by JosAH View Post
    Sorry I'm metric; yo no comprendo.

    kind regards,

    Jos
    5 kilometers ~ 3 miles
    "Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,071
    Rep Power
    23

    Default Re: Neeh help in task please

    Almost is as good as ~1.6km.

    Doesn't quite roll of the tongue, though...
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,372
    Blog Entries
    7
    Rep Power
    25

    Default Re: Neeh help in task please

    Quote Originally Posted by Tolls View Post
    Almost is as good as ~1.6km.

    Doesn't quite roll of the tongue, though...
    Waidaminnit, are we talkling about the golden ratio 'phi' here? ((1+sqrt(5))/2); 'almost is as good as phi km' sounds a bit better and can be understood by us metric folks too ;-)

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,071
    Rep Power
    23

    Default Re: Neeh help in task please

    I'll have to remember that one.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,372
    Blog Entries
    7
    Rep Power
    25

    Default Re: Neeh help in task please

    Quote Originally Posted by Tolls View Post
    I'll have to remember that one.
    Good, you do that; it's going to be checked later ;-)

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  12. #12
    kire9dk is offline Member
    Join Date
    Sep 2009
    Posts
    16
    Rep Power
    0

    Default Re: Neeh help in task please

    you can read some tutorials you now :) https://www.google.com/search?q=Java%20abstract%20class
    lets say the first one

  13. #13
    awinston is offline Student
    Join Date
    Jul 2012
    Location
    United States
    Posts
    328
    Rep Power
    5

    Default Re: Neeh help in task please

    Quote Originally Posted by Tolls View Post
    Almost is as good as ~1.6km.

    Doesn't quite roll of the tongue, though...
    As a cross country runner, 5k~3m is the one I always use
    "Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill

Similar Threads

  1. task
    By boys21 in forum Advanced Java
    Replies: 6
    Last Post: 05-28-2010, 01:59 PM
  2. Help with a task.
    By checho in forum New To Java
    Replies: 5
    Last Post: 01-14-2010, 12:29 PM
  3. Task Scheduler
    By fabs in forum Threads and Synchronization
    Replies: 3
    Last Post: 04-21-2009, 11:17 AM
  4. Need some help with a task, constructors.
    By JKM in forum New To Java
    Replies: 1
    Last Post: 02-01-2009, 11:09 PM
  5. Task Blocks 0.5
    By johnt in forum Java Software
    Replies: 0
    Last Post: 08-08-2007, 08:43 PM

Posting Permissions

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