Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Needs to be done in MIPS Assembly CS 231 Lab Decisions And Loops - Sum of Multiples of 6 Write a program that sums up

image text in transcribedNeeds to be done in MIPS Assembly

CS 231 Lab Decisions And Loops - Sum of Multiples of 6 Write a program that sums up positive multiples of 6 entered by a user. 1. Asks user "how many positive number that is devisable by 6 you want to add?". 2. The loop counter will be the user input. 3. If the user enters a positive number between 1 and 100 that is devisable by 6, you increment your loop counter and add it to the sum. You need to decide if the positive number entered by the user is divisible by 6 or not. 4. Your program should print an error message if the number is not within the range and ask user for another number. 5. Once the loop is completed out put the total on the screen. Example: How many positive numbers that are devisable by 6 do you want to add? 3 Enter a number: 36 --> 36 is divisible by 6 Enter a number: -20 --> **** ERROR: -20 is not a positive number. Enter another number. Enter a number: 0 --> **** ERROR: 0 is not in the range of 1 to 100. Enter another number. Enter a number: 21 --> 21 is not divisible by 6. Enter another number. Enter a number: 121 --> **** ERROR: 121 is not in the range of 1 to 100. Enter another number. Enter a number: 6 --> 6 is divisible by 6 Enter a number: 12 --> 12 is divisible by 6 The Sum of the positive numbers between 1 and 100 that are devisable by 6 is: 54

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: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions