MIPS (use MARS)
Write a program that asks the user what he wants the sentinel to be
enter numbers until the sentinel is entered.–do not save the entered numbers
output the sum of all the positive numbers
the sum of all the negative numbers
how many positive numbers were entered
how many negative numbers were entered
how many zeros were entered
output if the most “type” of numbers is positive, negative or zero
do not need to check for an invalid sentinel
may assume the counts for positive, negative, and zero will all be different.
if you check for an invalid sentinel, and check for “types” being the same you will get extra credit-remember any 2 may be the same, all 3 may be the same
use only these instructions (add, addi, sub, li, la, syscall, all forms of branch, move). no functions
be sure to comment
sample runs
Enter the sentinel value (may not be 0)999
Enter a Number: 1
Enter a Number: 0
Enter a Number: 0
Enter a Number: -2
Enter a Number: -2
Enter a Number: -2
Enter a Number: 999
Sum of positive numbers: 1 Sum of negative numbers: -6
There were 1 positive numbers, 3 negative numbers and 2 zeroes
there were more negative
program exiting
— program is finished running —