Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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
the name of your project must be first initial last name.asm so mine would be elichtenthal.asm
use only instructions we've done in class (add, addi,sub, li, la, syscall,all forms of branch, move). no functions
if you use an incorrect name, or instructions we haven't done as of today, it will not be graded.
be sure to comment
attach and upload the .asm file, or it will not be graded
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 --
Enter the sentinel value (may not be 0)999
Enter a Number: 1
Enter a Number: 0
Enter a Number: 0
Enter a Number: 0
Enter a Number: -2
Enter a Number: -2
Enter a Number: 999
Sum of positive numbers: 1 Sum of negative numbers: -4
There were 1 positive numbers, 2 negative numbers and 3 zeroes
there were more zeros
program exiting
-- program is finished running --
Enter the sentinel value (may not be 0)999
Enter a Number: 1
Enter a Number: 1
Enter a Number: 0
Enter a Number: -2
Enter a Number: -2
Enter a Number: -2
Enter a Number: 999
Sum of positive numbers: 2 Sum of negative numbers: -6
There were 2 positive numbers, 3 negative numbers and 1 zeroes
there were more negative
program exiting
-- program is finished running --
Enter the sentinel value (may not be 0)9991
Enter a Number: 1
Enter a Number: 1
Enter a Number: 0
Enter a Number: 0
Enter a Number: 0
Enter a Number: -1
Enter a Number: 9991
Sum of positive numbers: 2 Sum of negative numbers: -1
There were 2 positive numbers, 1 negative numbers and 3 zeroes
there were more zeros
program exiting
-- program is finished running --
Enter the sentinel value (may not be 0)999
Enter a Number: 1
Enter a Number: 1
Enter a Number: 1
Enter a Number: 0
Enter a Number: -1
Enter a Number: -1
Enter a Number: 999
Sum of positive numbers: 3 Sum of negative numbers: -2
There were 3 positive numbers, 2 negative numbers and 1 zeroes
there were more positive
program exiting
-- program is finished running --
Enter the sentinel value (may not be 0)999
Enter a Number: 1
Enter a Number: 1
Enter a Number: 1
Enter a Number: 0
Enter a Number: 0
Enter a Number: -2
Enter a Number: 999
Sum of positive numbers: 3 Sum of negative numbers: -2
There were 3 positive numbers, 1 negative numbers and 2 zeroes
there were more positive
program exiting
-- program is finished running --

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Identify three types of physicians and their roles in health care.

Answered: 1 week ago

Question

4. What decision would you make and why?

Answered: 1 week ago

Question

3. Review the evidence. Do you believe the testimony presented?

Answered: 1 week ago

Question

1. What are the marketing implications of this situation?

Answered: 1 week ago