Question: DUE DATE: March 12, 2021 (before 9 AM) Description: 1. Enter and modify the sum.s program to also compute and output the count and the

 DUE DATE: March 12, 2021 (before 9 AM) Description: 1. Enterand modify the sum.s program to also compute and output the count

DUE DATE: March 12, 2021 (before 9 AM) Description: 1. Enter and modify the sum.s program to also compute and output the count and the average. 2. If no data is enter, eg. O is the first input, then output the following message and quit: " No data entered " Required I/O: Sum by F. Last Enter data, use o to end input. ? # ? # ? 0 Count = # Sum = # Average = # The average is the integer average. # are user input values and program output values. sum.s .data title: asciiz "Sum by F. Last Enter data, use o to end input. " prompt: .asciiz "?" sumis: asciiz " The sum is 11 .text main: la li syscall $a0, title $v0, 4 # output program heading li $t0, 0 # sum: to while: $a0, prompt $v0, 4 # display prompt la li syscall la syscall beqz $v0, 5 # read data $v0, endw # if data 0, done # add input to sum $t0,$t0, $v0 while $a0, sumis $v0, 4 endw: # output result message add b la li syscall move li syscall li li syscall $a0,$t0 $v0, 1 # output sum # new line $a0, 'In $v0, 11 $v0, 10 # exit li syscall .end main

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!