printRectangle 🌶️
A sign painter marks out a rectangle with # characters. Write a method printRectangle that takes two ints, rows and cols (both 1 or more), and prints rows lines with cols characters # on each line. Use two loops: the outer one for the lines, the inner one for the characters on one line.
For example, printRectangle(2, 5) prints
##########
One line of
cols characters is one inner loop. How many times should that happen?Put the inner loop inside an outer loop that runs
rows times, and call System.out.println() after the inner loop ends, not inside it.