Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Basically, you will modify the mathq program to make it satisfy a different set of requirements, and fix what is not working in it.

Instructions

Basically, you will modify the mathq program to make it satisfy a different set of requirements, and fix what is not working in it. Specifically, imagine that the client for whom we created the mathq program for would now like some changes. To be exact:

Part 1: They want it to provide addition and subtraction problems as well as multiplication and division.

They still want the choice to be random, as before, but now the problem is randomly multiplication, division, addition, or subtraction.

For the addition and multiplication problems: the range of both operands is still limited to single digit numbers,

For the division and subtraction problems: The first operand is based on the second operand and the solution, where those are still limited to single digit numbers.

So,

18 / 9 = ? >

is allowed, not 9 / 18 = ? .

Hence, the answers to the division and subtraction problems generated should be positive, single digit numbers in most cases. So,

2 - 1 = ? >

is allowed, not 1 2 = ? .

Part 2: Concerning division problems: The divide-by-zero problem should be fixed. Although zero can be an operand in multiplication (the first or the second), it cannot be the divisor (the second operand) in a division problem. So,

0 / 1 = ? >

is allowed, but not 1 / 0 = ? .

Part 3: Concerning subtraction problems: The subtrahend is the number that is subtracted from the minuend. The problems cannot have value of zero as the minuend (the first operand), although it can be the subtrahend (the second operand). So,

6 0 = ?

>

is allowed, but not 0 - 6 = ? .

The only situation where zero is permitted to be the minuend is it if is subtracted from itself. That is,

0 0 = ? >

is the only circumstance of zero minuend allowed.

Part 4: The user should be able to type either the letter character 'q' or 'Q' to quit the mathq program.

Part 5: When the program starts, in addition to displaying a "welcome message", it should display a message to the user about how to quit the program anytime.

Part 6: Reporting a score would likely motivate the user to continue playing the game. The program should display the user's score after they quit the mathq program.

Each time the user answers a question correct, they earn 1 score point.

An incorrect answer is worth 0 points.

Only correct and incorrect answers are counted, not invalid responses.

When the user quits, the program should display the total number of correct and incorrect responses. For example, if the user answered 12 questions correctly and 6 questions incorrectly, the program would display something like:

You answered 12 out of 18 questions correctly.

Thank you for playing mathq.

The score is announced only when the user answers questions. When the user quits the mathq program immediately without properly playing the game, the score should not be announced, since they have not answered any questions in the appropriate manner to earn a score.

20 additional points: Part 7: The expression of the users score of correct answers reported as a percentage, for both the total number of questions, and for each type of question. Each statistic should be included in the score presentation. For example,

You answered 12 out of 18 questions correctly, or 67% correctly. For the addition problems, you answered 75% correctly. For the subtraction probems, you answered 75% correctly. For the multiplication problems, you answered 80% correctly. For the division problems, you answered 40% correctly.

Thank you for playing mathq.

All programs must be thoroughly tested before they are released to users. How should you test the program? This is an interactive program, so it is not a matter of creating many files and running the program on them. You have to pretend you are a user and play many games with it, giving it invalid responses, valid responses, right answers, wrong answers, and so on. Make sure that it counts the correct answers properly, and incorrect ones. What happens if the user quits without playing at all? Make sure it works as intended for that situation as well.

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions