Question
Write a MIPS math quiz program in MARS. The program should start with a friendly user greeting. From there, it should generate a random arithmetic
Write a MIPS math quiz program in MARS.
The program should start with a friendly user greeting. From there, it should generate a random arithmetic problem. Your program will need to generate three random things: the first and second operand and the operator to use. Your program should generate random positive integers no greater than 20 for the operands. The possible operators are +, -, * and % (MOD). The user should be prompted for an answer to the problem. If they are correct or incorrect, the program should inform them either way.
Continue prompting the user to solve addition problems until they enter a value of -1. If they enter -1, print out their score (how many problems they solved correctly/incorrectly, along with a percentage of how many were correct). Then quit the program.
Heres a sample run of the program (user input is highlighted):
Hello, welcome to MathQuiz, here is your first problem:
What is 3 + 14? 17
Correct!
What is 8 5? 4
Incorrect!
What is 10 + 10? -1
You solved 2 math problems and got 1 correct and 1 incorrect, for a score of 50%.
Thanks for playing!
(exit)
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