Write a program that asks the user what he wants the sentinel to be enter numbers until the sentinel is entered.

Words: 279
Pages: 2
Subject: Uncategorized

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 —

Let Us write for you! We offer custom paper writing services Order Now.

REVIEWS


Criminology Order #: 564575

“ This is exactly what I needed . Thank you so much.”

Joanna David.


Communications and Media Order #: 564566
"Great job, completed quicker than expected. Thank you very much!"

Peggy Smith.

Art Order #: 563708
Thanks a million to the great team.

Harrison James.


"Very efficient definitely recommend this site for help getting your assignments to help"

Hannah Seven