1. Write a method starString that takes an integer as its input and returns a string of asterisks whose length is that integer:
starString(5) returns "*****" starString(3) returns "***" starString(0) returns ""
2. Write a method drawSquare that takes an int called n as its only input. It does not return anything, but it prints out n lines of n asterisks:
drawSquare(5) prints:***** ***** ***** ***** *****
3. Change this loop so it prints ABCDEFGHIJKLMNOPQRSTUVWXYZ with one character being printed each time through the loop.
HINT: Google a Unicode table so you can get the right values and cast the numbers as (char)
for (int i = 0; i < 26; i++) {
System.out.print(i+1);
}
4. The procedure cross takes an int as its input and prints a cross made out of octothorpes.
Example:
cross(2) -->
##
##
######
######
##
##
cross(5) -->
#####
#####
#####
#####
#####
###############
###############
###############
###############
###############
#####
#####
#####
#####
#####
Write cross.