Problem:

Mr. Statos’s 5^{th} grade class has just finished learning multiplication and division by 12. You want to write a program that will generate quizzes for his students that will test all four arithmetic operations – addition, subtraction, multiplication, and division.

The quiz will have 50 questions. The questions will involve the four arithmetic operations randomly. You will also generate two operands. The requirements for the operands are as follows:

**Addition: ** Both operands are positive two digit numbers.
**Subtraction: ** Both operands are positive two digit numbers. Arrange the subtraction so that the user is subtracting the smaller number from the bigger number.
**Multiplication: ** Both operands are positive numbers in the range 0 through 12, both numbers inclusive.
**Division: ** The dividend (numerator) will be a positive two digit number. The divisor (denominator) will be a number in the range 1 through 12, both numbers inclusive. For division, we are interested only in the quotient and not in the remainder.

Your program will number each question that it prints out. It will read the answer the user inputs. If the answer is wrong, it will print the correct answer. The program will keep a tally of how many questions the user gets correct. It will print the total score at the end.

If the user gets 46 to 50 questions correct, your program will print **Great Job**. If the user gets 40 to 45 questions correct, your program will print **Good Attempt**. If the user gets less than 40 questions correct, your program will print **Better effort next time**.

Your program should also give the user the option of trying another quiz. If the user decides on another quiz, then a fresh quiz is generated. If the user decides to quit, then the program thanks the user for taking the quiz.

My Solution

This is probably not the most efficient solution. You should try to write a better solution.

### Like this:

Like Loading...

*Related*

This entry was posted on 10/02/2009 at 01:17 and is filed under Classwork. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

## Leave a Reply