CS21 Homework 6
Due Sunday, October 5 by 11:30pm


Introduction

This assignment serves two purposes. First, you can continue to practice using top-down design and second, you will learn to use the random number library. This assignment has been adapted from programming exercises 8.8 and 8.9 from our textbook The Art and Science of C.

You should work on your own for this assignment.


Educational Software: A Math Quiz

As computers become more common in schools, it is important to find ways to use them to aid in the teaching process. This need has led to the development of an educational software industry that has produced many programs that help teach concepts to children. As an example of an educational application, write a program that poses a series of simple arithmetic problems for a student to answer, as illustrated by the following sample run:
Welcome to Math Quiz.
This program will ask you a series of 5 math
questions using addition and subtraction. 
Have fun!

1. What is 5 - 4? 1
You rock!

2. What is 9 - 7? 2
Nice job.

3. What is 16 - 7? 8
That's incorrect.  Try a different answer: 9
Well done.

4. What is 12 + 3? 16
That's incorrect.  Try a different answer: 17
That's incorrect.  Try a different answer: 11
No, the answer is 15

5. What is 17 - 6? 11
Yes indeed.

You answered 4 out of 5 questions correctly.
Goodbye and thanks for using Math Quiz.

Getting Started

Remember that your main program should be short and abstract. Most of the details for solving the problem should be divided up into functions.

Your program should meet the following requirements:


Handing in your solution

Use cs21handin to turn in your program.