Question: This program will print out a pattern with numbers and stars (asterisks). 1. It will first prompt for the height of the pattern. If
This program will print out a pattern with numbers and stars (asterisks). 1. It will first prompt for the height of the pattern. If the user enters an invalid input such as a negative number or zero, an error message will be printed and the user will be prompted again. 2. Each symbol(either a number or space) should be separated by a tab (not space) 3. Then your program should print the following pattern using numbers and stars with a tab between each of them. Example Outputs User inputs 0,-1, and then 5 Enter the height of the pattern (must be greater than 0): Invalid Entry! Enter the height of the pattern (must be greater than 0): Invalid Entry! Enter the height of the pattern (must be greater than 0): 2 3 u2u*u3 4u*u*u*u5 9 O program is finished running T -- program is finished running -- For a triangle with height 3, see the figure below. Note that the 'u' character indicates a tab. Also, note that there is a newline after the triangle is finished printing before the program terminates. 5 Enter the height of the pattern (must be greater than 0):u3 uu1
Step by Step Solution
There are 3 Steps involved in it
CODE data msg1 asciiz Enter the height of the patternmust be greater than 0 msg2 asciiz Invalid Entr... View full answer
Get step-by-step solutions from verified subject matter experts
