CS110 Introduction to Computing
Fall 2006

Lab Assignment#6



Problem: This assignment serves two purposes. First, it is the largest program we have written so far, so it will give you the chance to practice breaking up a problem into modular functions. Second, there are lots of opportunites to use the if decision structure. In the class, we will help you design the overall structure ofthe program. Please follow those design guidelines closely to learn how to design and then incrementally implement the program.

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. We strongly encourage you to build up your solution incrementally. You should add and test one function at a time, stubbing out the rest.

Your program should meet the following requirements:

For extra credit, change the program from text-based to a GUI. You should not try to add any graphical features until all of the above requirements are met.

What you will need to do

  1. Make sure you have read all of Chapters 6 & 7 and understand the examples and library functions presented there.
  2. Do the design first: plan out a complete sketch prior to writing your program. This is will be presented in class.
  3. Split your program into functions and make an incremental implementation plan.
  4. Make sure you do the above steps prior to entering the lab (or using your computer).
  5. Test and debug your program until it produces correct results.
  6. When done, print out the final version your your program and also a printout showing your program's sample outputs for at least two sessions.
  7. Make a blog posting saying that you have completed the assignment and also write up any logistical or other issues/questions raised while working on this assignment. Also write about your level of confidence on the concepts learned so far.
  8. ALL work in this course should be done individually without any help from any person other than the class TA's and instructor(s).

Notes:

Add the following line to all your Python programs:

# File: <place name of your program file here>
# Date: <date created>
# Created by: <your name>
# Assignment: <place assignment number here>

Back to CS110 Course Page