Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

11. Are your speaking notes helpful and effective?

Answered: 1 week ago

Question

The Goals of Informative Speaking Topics for Informative

Answered: 1 week ago