So my homework assignment is to prompt a user to input a positive integer value, and use a while loop to make sure the value is not negative. Once the value is positive, the program should print out the input value as the number of lines with 2 pound signs starting with no space between them and spaces incrementing in each line.
so far I have this, but not really sure how to progress from here.
import java.util.Scanner;
public class Pattern
{
public static void main(String[] args)
{
Scanner kb = new Scanner(System.in);
System.out.print("Enter a positive integer: ");
int positiveInt = kb.nextInt();
while (positiveInt < 0)
{
System.out.print("That isn't positive, try again: ");
positiveInt = kb.nextInt();
}
}
/* an example would look like this:
##
# #
# #
# #
# # */