Question: Using MIPS Assembly (MARS): 1. It will first prompt for the height of the triangle. Then use the height h to print h rows. If

Using MIPS Assembly (MARS):

1. It will first prompt for the height of the triangle. Then use the height h to print h rows. 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. At the start of each row, except the last row, print a number of tabs (not spaces) as the indent to center the row. The number of tabs should appropriately align the columns exactly as shown.

3. Then your program should print numbers and stars alternatively with a tab between each number and star.

Using MIPS Assembly (MARS): 1. It will first prompt for the height

Example Outputs User inputs 0,-1, and then 5 Enter the height of the triangle (must be greater than ): 0 Invalid entry! Enter the height of the triangle (must be greater than 0): -1 Invalid entry! Enter the height of the triangle (must be greater than 0): 5 * N 00 * *U * * 11 * * 15 -- program is finished running -- For a triangle with height 4, see the figure below. Note that the 'u' character indicates a tab. See that line 4 (last row) contains no tabs before the number, line 3 contains 1 tab, line 2 contains 2, etc. Also note that there is a newline after the triangle is finished printing, before the program terminates. Enter the height of the triangle (must be greater than 0): 4 uuul uu 20*13 140*50*16 70*480*u9u*u10 -- program is finished running -- Example Outputs User inputs 0,-1, and then 5 Enter the height of the triangle (must be greater than ): 0 Invalid entry! Enter the height of the triangle (must be greater than 0): -1 Invalid entry! Enter the height of the triangle (must be greater than 0): 5 * N 00 * *U * * 11 * * 15 -- program is finished running -- For a triangle with height 4, see the figure below. Note that the 'u' character indicates a tab. See that line 4 (last row) contains no tabs before the number, line 3 contains 1 tab, line 2 contains 2, etc. Also note that there is a newline after the triangle is finished printing, before the program terminates. Enter the height of the triangle (must be greater than 0): 4 uuul uu 20*13 140*50*16 70*480*u9u*u10 -- program is finished running

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!