I need help making a program where you allow the user to enter a character and a number and output a square on the screen which consists of the character with sides equal to the number entered.
e.g. User enters $ and 5 – and outputs
$$$$$
$ $
$ $
$ $
$$$$$
I tried this so far, but I don't know how to get rid of the characters inside the box.
int r,c;
System.out.println (" Please enter the number of rows for the rectangle.");
r=sc.nextInt();
System.out.println (" Please enter a character for the rectangle.");
c=sc.nextInt();
for (int x=r;x>=1;--x) {
for (int y=r;y>=1;y--) {
System.out.print (c);
}
System.out.println (c);
}