Question: Please help my with the following code, is supposed to do the following task task 1: Print Assignment information : example YOUR_NAME CS2810 Program #2

Please help my with the following code, is supposed to do the following task

task 1: Print Assignment information : example

YOUR_NAME CS2810 Program #2 Bye. -- program is finished running --

Task 2: Capture input as integer and test value example:

With a Good value then,

YOUR_NAME CS2810 Program #2 Enter a number >= 15: 9 You entered a number <= 15 Bye. -- program is finished running -- 

With a number greater or equal to 15

YOUR_NAME CS2810 Program #2 Enter a number >= 15: 18 You entered a number >= 15 Bye. -- program is finished running --

Task 3: Capture input as string and print it in a loop example:

YOUR_NAME CS2810 Program #2 Enter a number >= 15: 16 You entered a number >= 15 Enter your favorite string Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Real Madrid Bye. -- program is finished running --

With a "bad" number. In this case after you print the "bad" number message, you jump to the end: label and print the bye message.

YOUR_NAME CS2810 Program #2 Enter a number >= 15: 5 You entered a number < 15 Bye. -- program is finished running --

This is my code so far

# Author: # Date: # Description: .data #string constants info: .asciiz "YOUR_NAME CS2810 Program #2 " bye: .asciiz "Bye " ###### Other prompt labels prompt_num: .ascii # prompt_num: good_num: .asciiz # good_num: bad_num: .asciiz # bad_num: prompt_str: .asciiz "Enter your favorite string " # save space for 63 character input, plus the null character text: .space 64 .text .globl main main: la $a0, info li $v0, 4 syscall # Task 1: print(info) loop: la $a0, prompt_num # Task 2: Capture number li $v0, 4 # print(prompt_num) syscall

li $v0, 5 # capture input number syscall move $s0, $v0 # save it in $s0 # Test number slti $s0, $s0, 15 # if (num <= 15) { beq $s0,0,good_num

la $a0, bad_num li $v0, 4 #print(bad_num) syscall j endloop #if the number is less than 15 so go to endloop and don't continue

# } else { good_Num: la $a0, good_num li $v0, 4 #print(good_num) syscall j loop endloop:

end: la $a0, bye # print(bye) li $v0, 4 syscall

# Task 4: Capture string # print(prompt_str) # text = readStr() # Task 5: Loop $s0 times and print string # while ($s0 > 0) { # print(text) # $s0 = $s0 - 1 # }

# print(bye)

# exit li $v0, 10 # set up exit syscall syscall

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!