Drawing a rectangle

  • 4
Expressive drawing using the modest tools of pseudographics is the same as minimalism in music. At least, some critics on Earth think so. Well, let's heed their words and do some drawing. Let's enter two numbers m and n, and draw a rectangle of eights. The rectangle will be m eights high and n eights wide.
You can't complete this task, because you're not signed in.
Comments(9)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Jimmy PhanLevel 7 , Atlanta
24 October 2019, 17:57
Not sure if this will really help anyone out but; I renamed m as rows and n as columns. It might help you get a better understanding of which loop is doing what.
Asma SadiaLevel 15 , Brooklyn
9 October 2019, 05:04
Don't print n*m. It just wants you print the number eight.
Sam Level 8 , ELIZABETH
15 November 2019, 13:03
they should have used numbers that does not coincidentally multiplies to 8
Tauqeer ArifLevel 7 , Jhelum
5 October 2019, 07:10
What the hell is going on ?
Azhar IqbalLevel 18 , Multan
29 August 2018, 12:03
for(int i=0; i<8; i++){
          for(int x=0; x < 4;x++){
              System.out.print(n*m);
          }
          System.out.println();
      }
What's the problem how many times in rows display the text???
RomanLevel 41
30 August 2018, 05:39
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
RyonLevel 9 , Manila
16 September 2018, 23:36
Your program should be reading a keyboard input. Do not explicitly indicate a constant in your for loop conditions
for(int i=0; i<8; i++) { // I am talking about i < 8
          for(int x=0; x < 4;x++){ // and this x < 4
               System.out.print(n*m); // Watch out for this...
           }
           System.out.println();
       }
And also, your program should just be printing the number '8' when making the box.
18 March 2019, 20:12
package com.codegym.task.task04.task0436;
/*
Drawing a rectangle
*/
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

public class Solution {
    public static void main(String[] args) throws Exception {
     ...
    }
}
RomanLevel 41
19 March 2019, 08:29
Posting the solution in the comments is prohibited.