Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

# Thread: Java Exercise: Tables of squares and cubes

1. ## Java Exercise: Tables of squares and cubes

Hi guys , please help me with this homework. I kinda find it hard to do.

Write an application that calculates the squares and cubes of the numbers from 0 to 10 and prints the resulting values in table format.
Note: This program does not require any input from the user.

2. ## Re: Java Exercise: Tables of squares and cubes

What have you tried?

Start by writing down on a piece of paper what the program's output should look like. Then think about how the program could create it.

3. ## Re: Java Exercise: Tables of squares and cubes

I have done that already but I have no idea on how to make it appear in a table form.

--- Update ---

Can you tell me what the source code will look like?

4. ## Re: Java Exercise: Tables of squares and cubes

Can you post a sample of what the program's output should look like? Describe what goes on each line of the output and what the program needs to compute to create that output.

To print more than one value on a line, use the print() method. When you want the next thing printed to go on the next line use the println() method.

5. ## Re: Java Exercise: Tables of squares and cubes

You need to give us an idea what YOU think it looks like, and then we can work with that. If it's the best you can do, post what you wrote down on paper - please, not a picture, type it out.

6. ## Re: Java Exercise: Tables of squares and cubes

i already made a codes of that but i already format...it's kindda hard u know...

7. ## Re: Java Exercise: Tables of squares and cubes

It's even harder to help you without seeing your effort, impossible in fact. Post it.