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

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

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

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

db