Results 1 to 3 of 3
  1. #1
    syngine90 is offline Member
    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Default Having a hard time figuring this out! Please help.

    Hey... So I've got a couple problems that I can't find anywhere online or in my textbook and I'm pretty sure their simple if the right eye sees them. I obviously don't have the right eye for it! I'm just wondering if anybody could provide me some direction or show me how this could be done so that I could look at the code and learn from it. I'm very visual so being able to look at a completed or near completed product could definitely help. I'm trying to teach myself java and when I hit a speed bump like this it gets pretty frustrating. If possible... Please help! Thank you.

    I believe it's supposed to have a main class that links all these together.
    -------------------------------------

    Integer Math
    Create a class which stores an integer and answers questions about it. The class should have a constructor which takes the integer to analyze. You must determine the accessibility of the stored integer, should it be public, private or final? The object must answer the following questions:

    is the number odd or even?
    is the number divisible by 3? (3,6 & 9 are, 22 is not)
    is the number divisible by a given (parameter) integer?
    (12 is a power of 4, 29 is not a power of 5)
    -------------------------------------
    An Unchangeable Point
    This class represents a point in 2D space, that once made cannot be changed.

    I should be able to read the x and y values, but not change them.
    The values will be integers.
    I need to determine the distance from another point.
    For example: (1,1) is ~4.2426 away from (4,5)
    I need to be able to get a point that is offset from the original
    For example: (1,3) offset by (-1, -1) is (0,2)
    -------------------------------------
    Circle Math
    This class represents a circle in 2D space and does calculations on it.

    It can be made with a point (see previous part) and a radius.
    I need to be able to ask the objects for their area and perimeter.
    For example: a circle with radius 3 has an area of ~28.2743
    For example: a circle with radius 3 has a perimeter of ~18.8495
    It should be able to determine if another point is inside it
    For example: (1,3) is inside a circle at (1,1) with a radius 4

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,436
    Blog Entries
    7
    Rep Power
    20

    Default Re: Having a hard time figuring this out! Please help.

    If you want us to create the code for you, you're in the wrong forum. We try to help if you're stuck in your own code but I don't see any code anywhere; give it a try and tell us what's troubling you. This must be homework so if we did it for you, it would be cheating, wouldn't it?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default Re: Having a hard time figuring this out! Please help.

    Please go through the Forum Rules, particularly the third paragraph.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 6
    Last Post: 07-15-2012, 12:56 AM
  2. HELP me with Binary Search Tree. hard time on it.
    By xajaxworldx in forum Advanced Java
    Replies: 4
    Last Post: 05-06-2011, 05:59 AM
  3. Replies: 6
    Last Post: 01-18-2011, 02:31 AM
  4. Static (having a hard time)
    By maknib in forum New To Java
    Replies: 4
    Last Post: 11-02-2010, 07:05 AM
  5. Extreme nooby having hard time with this app
    By asterix350z in forum New To Java
    Replies: 2
    Last Post: 12-05-2007, 07:24 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
  •