Results 1 to 2 of 2
  1. #1
    Jar
    Jar is offline Member
    Join Date
    Jan 2014
    Posts
    5
    Rep Power
    0

    Default help with nested for loops to capture the structure of the figure

    Hi , i am really new to java and just looking for some help with some problems like this nested for-loop for instance ....

    -----1-----
    ----333----
    ---55555---
    --7777777--
    -999999999-



    Now i have to write a method called printDesign that produces the following output but i am not even entirely sure how to start it out now of course i know how to make a for-loop but and i guess if i was to do somehting for this i would do this .....

    Java Code:
    for(int*j=0;j<N-k;j++){
    System.out.print("-");*
    for(int*j=0;j<i;j++){
    System.out.print(i);*
    for(int*j=0;j<N-k;j++){
    System.out.print("-");*
    System.out.println();*
    }
    }
    }

  2. #2
    AlexGraal is offline Señor Member
    Join Date
    Jan 2014
    Posts
    181
    Rep Power
    0

    Default Re: help with nested for loops to capture the structure of the figure

    Wait I'm super confused.

    1. Didn't someone post this same exact problem like 3 days ago? And I thought it was you?

    2. If not, what are you actually trying to get it to print out?

    3. What is it printing out. AKA, what is it doing incorrectly.

Similar Threads

  1. Cannot figure out basic nested for loop
    By no_slip_condition in forum New To Java
    Replies: 5
    Last Post: 06-06-2013, 05:18 AM
  2. Replies: 20
    Last Post: 03-22-2011, 04:02 AM
  3. nested for loops
    By Implode in forum New To Java
    Replies: 4
    Last Post: 09-01-2009, 08:47 AM
  4. Nested Loops
    By ks1615 in forum New To Java
    Replies: 4
    Last Post: 02-18-2009, 02:48 AM
  5. Nested loops?
    By gabriel in forum New To Java
    Replies: 4
    Last Post: 08-06-2007, 04:51 PM

Tags for this Thread

Posting Permissions

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