Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use QtSpim. ########################################################### # Description: # Write a program that will input six integers into an array, # and then print them out to the

Use QtSpim.

image text in transcribed

########################################################### # Description: # Write a program that will input six integers into an array, # and then print them out to the console. You will also # print the sum of all the values before your program ends # and save the result into an integer variable. # # You will need to define two variables, one for the array # and one to hold the sum. You can initialize all values # of the array and the initial sum to 0. # ########################################################### # Register Usage # $t0 Holds array base address # $t1 Holds the array counter # $t2 Holds the sum # $t3 # $t4 # $t5 # $t6 # $t7 # $t8 # $t9 Temporary register ########################################################### .data prompt_p: .asciiz "Enter an integer: " array_p: .asciiz " Array: " sum_p: .asciiz " Sum: " space_p: .asciiz " "

# TODO: create static array of 6 integers

# TODO: create an integer variable and store the sum into it ########################################################### .text main:

mainEnd: li $v0, 10 syscall # Halt

###########################################################

Define two variables: one static (integer) array and one to hold an integer sum. The array should hold 6 integers. Write a loop to input integers from the user to fill the array. Write a second loop that will print each number in the array to the console. . Example format: "Array: 1 2 3 4 5 6" Add code to collect the sum of all values as you're printing out each value. Insert the sum into your defined variable. Print the resulting sum to the console. Define two variables: one static (integer) array and one to hold an integer sum. The array should hold 6 integers. Write a loop to input integers from the user to fill the array. Write a second loop that will print each number in the array to the console. . Example format: "Array: 1 2 3 4 5 6" Add code to collect the sum of all values as you're printing out each value. Insert the sum into your defined variable. Print the resulting sum to the console

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions