Right now my code is generating half of what it is supposed to.
Program asks the user to enter a number from 1 to 10.
Enter 7
output will be $$$$$$$
I'm having issues with my if statement. Once you put in the wrong number it should ask for another number and so on.
If statement:
if( num < 1 || num > 10) { System.out.print("The number you entered is invalid"); }
public static void main(String [] args) { Scanner keyboard = new Scanner(System.in); int num; int num_of_rows = 1; System.out.print("Enter a number from 1 to 10: "); num = keyboard.nextInt(); for (int row = 1; row <= num_of_rows; row++) { for ( int column = 1; column <= num; column++) { System.out.print("$"); } } System.out.println(); System.exit(0); }