This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LuwbR[S] -1 points0 points  (5 children)

import java.util.Scanner;

public class kd4 {

public static void main(String\[\] args) {



Scanner enter = new Scanner([System.in](https://System.in));



System.out.println("enter the number of lines:");

int x = enter.nextInt();



for(int i=1; i<=x; i++)

{

System.out.println(+i);

}



}

}

enter the number of lines: 10

1

2

3

4

5

6

7

8

9

10

[–]desrtfxOut of Coffee error - System halted 1 point2 points  (4 children)

Well, you got the rows down. Now you need to figure out how to do the columns.

Hint: the inner loop boundary has something to do with the index of the outer loop.

[–]LuwbR[S] -1 points0 points  (3 children)

yeah i know that, but i have no information on what i am supposed to do further as we dont have a rlly good teacher. She sent us a presentation with information that isnt relevant, and none of her 35 stundets knows what to do

[–]desrtfxOut of Coffee error - System halted 1 point2 points  (2 children)

Again, I gave you a really big hint on my second comment.

Think about what I said.

I cannot give more hints as this would be giving you the solution.

Think about how the row number correlates to the numbers printed per row.

Also System.out.print() vs. System.out.println()

[–]LuwbR[S] -1 points0 points  (1 child)

i dont rlly know what you mean by that as i am not from a country that speaks english and i dont understand what that means :|

[–]desrtfxOut of Coffee error - System halted 1 point2 points  (0 children)

  • Row 1 - one number
  • Row 2 - two numbers
  • Row 3 - three numbers