MCPcopy Create free account
hub / github.com/Hazrat-Ali9/Computer-Programming / Problem14

Class Problem14

Problem14.java:5–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import java.util.Scanner;
4
5public class Problem14 {
6
7 public static void main(String[] args) {
8 // TODO Auto-generated method stub
9 Scanner input = new Scanner(System.in);
10 int T = input.nextInt();
11
12 while (T < 1 || T > 25) {
13 T = input.nextInt();
14 }
15 int[] allT = new int[T];
16
17 for (int i = 0; i < T; i++) {
18 int n = input.nextInt();
19 while (n < 1 || n > 100) {
20 n = input.nextInt();
21 }
22 allT[i] = n;
23 }
24 input.close();
25
26 for (int i = 0; i < allT.length; i++) {
27 drawSquare(allT[i]);
28 System.out.println();
29 }
30
31 }
32
33 public static void drawSquare(int number) {
34 for (int i = 0; i < number; i++) {
35 for (int j = 0; j < number; j++) {
36 System.out.print("*");
37 }
38 System.out.println();
39 }
40 }
41}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected