Introduction to Computer Programming - CSCI-UA.0002-008 - Fall 2016

feeling_quizzy.py (9 points)

Importing Functions

Use the functions from your file, funcynum, to create a math quiz.

import funcynum
funcynum.print_two('*', 5)

Math Quiz Description

Your math quiz program will:

  1. ask for some parameters to the game…
  2. and then it will display a series of addition and subtractions questions using your library of print_xxxxxx functions from funcynum.py.
  3. It will ask for an answer and check that answer using your check_answer function from funcynum.py.
  4. At the end, it will show the percentage of correct answers.

Step by step:

An example game is below. Note the validation that occurs for the number of problems and the characters…

How many problems?
> 2
Please enter a number between 5 and 20...
How many problems?
> 3
What character do you want the numbers to be made of?
> ccc
Please enter a single character!
What character do you want the numbers to be made of?
> X
How wide do you want each number to be?
> 3

 What is ...
XXX
X X
XXX
  X
  X

 X
 X
XXX
 X
 X

  X
  X
  X
  X
  X
 = 10
Correct!

 What is ...
XXX
  X
XXX
  X
XXX



XXX



XXX
X X
XXX
  X
  X
 = -6
Correct!

 What is ...
XXX
X
XXX
  X
XXX

 X
 X
XXX
 X
 X

XXX
X X
XXX
  X
  X
 = 10
Nope, the answer is 14
You got  66.67% correct (2 out of 3)

CSCI-UA.0002-008 - Introduction to Computer Programming - Fall 2016