Question
Using QtSPIM Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents. i cant
Using QtSPIM
Write a program that tells what coins to give out for any amount of change from 1 cent to 99 cents.
i cant get this to work and I need some help. my code is below: if someone can help me get it started. it would be great
.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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started