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


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Java Exercise: Tables of squares and cubes

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    3
    My Mood
    Cool
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,602
    Thanks
    45
    Thanked 1,956 Times in 1,930 Posts

    Default 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.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    3
    My Mood
    Cool
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,602
    Thanks
    45
    Thanked 1,956 Times in 1,930 Posts

    Default 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.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    3,405
    My Mood
    Mellow
    Thanks
    83
    Thanked 472 Times in 463 Posts

    Default 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. #6
    Junior Member
    Join Date
    Nov 2013
    Location
    Butuan city
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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. #7
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    3,405
    My Mood
    Mellow
    Thanks
    83
    Thanked 472 Times in 463 Posts

    Default Re: Java Exercise: Tables of squares and cubes

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

Similar Threads

  1. Replies: 2
    Last Post: October 25th, 2013, 06:31 AM
  2. How to do simple formatting in java times tables?
    By theJastro in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 20th, 2011, 10:18 AM
  3. Creating Excel Pivot Tables using Java
    By prasad.virgo in forum Threads
    Replies: 4
    Last Post: August 4th, 2010, 12:20 PM
  4. merging two tables from two diffrent htmls files using java
    By sukant_at in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: September 1st, 2009, 05:13 AM
  5. merging two tables from two diffrent htmls files using java
    By sukant_at in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: August 7th, 2009, 12:48 PM