Question: Using QtSPIM Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents. .data title:

Using QtSPIM

Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents.

.data title: .asciiz " Enter a number 1 to 99 and get change: " quarter: .asciiz " Quarters due: " dime: .asciiz " Dimes due: " nickle: .asciiz " Nickles due: " penny: .asciiz " Pennys due: "

.text

main: la $a0,title #display title li $v0,4 #call code to print string syscall #Print title string la $v0,5 #reads data (calls system to read argument) syscall #Read entered value in $t0 q25: la $t0,quarter #display quarter li $v0,4 #call code to print string syscall #print Quarter string

beqz $t0,endif # if t0 == 0, then goto endif

move $a0, $t0 li $v0,1 syscall la $a0,newline li $v0,4 endif:

li $v0,11 syscall li $v0,10 #exit syscall

.end main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!