This program will print out a pattern with numbers and stars (asterisks, ascii hex code 0x2a) and blankspace (ascii hex code 0x20).1. It will first prompt for the height of the pattern (i.e., the...

1 answer below »

This program will print out a pattern with numbers and stars (asterisks, ascii hex code 0x2a) and blank

space (ascii hex code 0x20).

1. It will first prompt for the height of the pattern (i.e., the number of rows in 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. These error messages are listed in the starter code in the Lab3.asm file provided.

2. Then your program should generate the following pattern, a "hollow right-angled triangle", using

stars, blank space and newline (ascii hex code 0x0a) characters. Refer to test cases in testCases sub folder

in Lab3 folder for examples.

3. This entire pattern generated from the user input of n is written to the file lab3_output.txt.



This program will print out a pattern with numbers and stars (asterisks, ascii hex code 0x2a) and blank space (ascii hex code 0x20). 1. It will first prompt for the height of the pattern (i.c., the number of rows in 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. These error messages are listed in the starter code in the Lab3.asm file provided. 2. Then your program should generate the following pattern, a "hollow right-angled triangle", using stars, blank space and newline (ascii hex code 0x0a) characters. Refer to test cases in testCases sub folder in Lab3 folder for examples. 3. This entire pattern generated from the user input of n is written to the file lab3 output.txt. The actual task of opening the file lab3 output.txt and writing the contents to it is borne by macros used in starter code included in the Lab3.asm file. Consider the screenshot of the Lab3.asm file below: NOTE: For your student starter code, you MUST NOT use any of the following registers: a0, al, a7, t6, sp. Using the registers t0 through t5 should be enough for Lab3 assignment. Example of running the actual correct Lab3.asm source code The following is a screenshot showing the runtime of the actual solved Lab3.asm code: ter n (must be greater than 0):-5 Invalid Entry! ter n (must be greater than 0):0 Invalid Entry! ter n (must be greater than 0):6 display pattern saved to lab3_output.txt - program is finished running (0) -- Figure 16 Solved Lab3.asm runtime demo When we open the generated lab3 output.txt file, we get the following text: x EE Ahk ig ER Figure 17 lab3_output.txt screenshot Your student code MUST display the prompts and error messages in response to user input EXACTLY as shown in Figure 16. Please make use of the provided strings in the .data section of the starter code in Lab3.asm to make sure you do not use any other type of sentence! NOTE: Although you are not required to print each row in the patter on your output console, doing so (as shown in Figure 16 ) will greatly help in the real time code debugging. So it is strongly advised to do so. Test Cases The Lab3 folder in the Google Drive contains some test cases in testCases sub folder for the case when user input was n=1, 3, 6, 9, 30. Make sure your code output generates the exact same alignment of characters as provided there for the corresponding n input in your student code.
Answered 4 days AfterNov 09, 2022

Answer To: This program will print out a pattern with numbers and stars (asterisks, ascii hex code 0x2a) and...

Nidhi answered on Nov 12 2022
48 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here