I am a trying to write a program for my class that asks the users for a keyboard character and then for number of rows and columns, then displays the character in a rectangle shape based on the rows and columns.
var keyBoardInput = prompt("Pick a key on your keyboard to display");
var x = prompt("How many rows?");
var y = prompt("How many columns?");
rectangleX = new Array(x);
rectangleY = new Array(y);
for(var i =0; i < rectangleX.lenght; i++)
{
rectangleX.push(keyBoardInput);
}
for(var j =0; j < rectangleY.lenght; j++)
{
rectangleY.push(keyBoardInput);
}
I'm not sure how to get it to output so say if there was 3 rows and 2 columns and the user chose a as the keyboard input, I would need an output of something like:
aaa
aaa