Kindergarten Math Game
VerifiedAdded on 2019/09/25
|5
|1458
|185
Practical Assignment
AI Summary
This assignment requires students to develop a Python program that uses the Zelle graphics library to create an educational math game for kindergarten children. The game should present 15 addition and subtraction problems with randomly generated numbers between 0 and 20, ensuring the results remain within the same range. The program should provide instant feedback (green circle for correct answers, red circle and correct answer for incorrect answers). A final summary of correct and incorrect answers and the percentage of correct answers should be displayed. The assignment is divided into two phases: a design phase involving pseudocode creation and a coding phase where students implement the game using functions for number generation, operation selection, result calculation, verification, problem display, feedback, and statistics display. A bonus section extends the game to include elementary school students, allowing for negative numbers and larger numbers, along with increased difficulty levels and image-based feedback.

Math for kindergarten
BACKGROUND
In this lap you are required to write a python program that uses the graphics library
(created by Zelle) to help kindergarten kids learn the basic mathematical operations
(addition and subtraction). Your program will be similar to some app published inside
apple/google stores. The program displays several mathematical problems, where
each problem uses the random library to generate two numbers and a random
operation (0 for addition and 1 for subtraction). The program then allows the kid –
user- to enter his/her answer. Your program then compares the user’s answer with the
right now and then give an instance feedback for the user on whether the answer was
right or wrong. At the end of the program, the user should see a summary of number
of questions, number of correct answers, number of wrong answers, and percentage of
the correct answers.
In this program you are required to use the if statement, loop, functions, graphics
library. You should define and use several functions to write this program. The
program will also use random number library to choose the two numbers for every
problem and the mathematical operations that will be used in every problem - addition
or subtraction-. These two numbers should be between 0 and 20 (inclusive). Your
program should make sure that the mathematical problem result should be between 0
to 20 (remember that kindergarten kids don’t know negative numbers or numbers
larger than 20). In case the result is less than 0 or larger than 20, then your program
should generate another problem. Once the user input his/her answer to the problem
using the entry object, the program gives feedback to the user based on comparing the
answer to the real answers. A green circle will be displayed at the bottom of the screen
in case the answer is correct, while a red circle and the correct answer will be
displayed at the bottom of the page in case the answer is wrong. This process is
repeated 15 times for 15 different problems. At the end of the program, the user
should see a summary of number of questions, number of correct answers, number of
wrong answers, and percentage of the correct answers.
The program contains the following graphical part:
1. A screen that display two random numbers, the random operation, and an entry
for the user to input his/her answer.
2. Once the user has entered his/her answer, a feedback is given to the user.
3. The final result which represent the percentage of the corrected answers.
4. The program then waits for a click before terminating the game. Due Dates
BACKGROUND
In this lap you are required to write a python program that uses the graphics library
(created by Zelle) to help kindergarten kids learn the basic mathematical operations
(addition and subtraction). Your program will be similar to some app published inside
apple/google stores. The program displays several mathematical problems, where
each problem uses the random library to generate two numbers and a random
operation (0 for addition and 1 for subtraction). The program then allows the kid –
user- to enter his/her answer. Your program then compares the user’s answer with the
right now and then give an instance feedback for the user on whether the answer was
right or wrong. At the end of the program, the user should see a summary of number
of questions, number of correct answers, number of wrong answers, and percentage of
the correct answers.
In this program you are required to use the if statement, loop, functions, graphics
library. You should define and use several functions to write this program. The
program will also use random number library to choose the two numbers for every
problem and the mathematical operations that will be used in every problem - addition
or subtraction-. These two numbers should be between 0 and 20 (inclusive). Your
program should make sure that the mathematical problem result should be between 0
to 20 (remember that kindergarten kids don’t know negative numbers or numbers
larger than 20). In case the result is less than 0 or larger than 20, then your program
should generate another problem. Once the user input his/her answer to the problem
using the entry object, the program gives feedback to the user based on comparing the
answer to the real answers. A green circle will be displayed at the bottom of the screen
in case the answer is correct, while a red circle and the correct answer will be
displayed at the bottom of the page in case the answer is wrong. This process is
repeated 15 times for 15 different problems. At the end of the program, the user
should see a summary of number of questions, number of correct answers, number of
wrong answers, and percentage of the correct answers.
The program contains the following graphical part:
1. A screen that display two random numbers, the random operation, and an entry
for the user to input his/her answer.
2. Once the user has entered his/her answer, a feedback is given to the user.
3. The final result which represent the percentage of the corrected answers.
4. The program then waits for a click before terminating the game. Due Dates
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

(0 POINTS) STEP 1: DESIGN
Have a look over the program descriptions and come up with pseudocode that
describes how the program is going to be.
• Your first step to do that is create a python file name it “StudentName Section
XX lap7 .py”.
• Replace the StudentName with your real name and XX with your section
number .
• Write the program pseudocode (use plain English, not python code) as
comments inside your Python file. You should put # at the start of each line.
• Write your name, section and date on the top of the file as comments.
• After the # symbol, give every step of your design a number so you can refer
to this step later.
• You have to come up with a design that is at least 9 lines (other than your
information on the top of the file).
Your program's design starts out as:
1. Design Prolog - name, section, email, purpose, preconditions,
postconditions
2. In the main function, create a graphics window of size 600*600.
3. Use a for loop to ask the user 15 questions o Inside the for loop.
…
4. Display the user results.
• Once you done, save your work for the next phase.
(100 POINTS) CODING PHASE
Go back to your file that you made in the previous phase and start to inset a
python code between the lines of design you came up with. Your code should
define and use the following function.
• A function called GeneratTwoNumbers that does not take any parameters.
The function generates two integer random numbers and return them back.
• A function called GeneratOperation that does not take any parameters. The
function generates a random integer number between 0 and 1 (0 represents
addition and 1 represents subtraction). Then the program returns it back.
• A function called OperationResult that receives three parameters. The first
two parameters represent the operand of the operation and the third
parameter represents the operation itself. The function calculates the result
of mathematical operation between the two operands and returns back one
result.
Have a look over the program descriptions and come up with pseudocode that
describes how the program is going to be.
• Your first step to do that is create a python file name it “StudentName Section
XX lap7 .py”.
• Replace the StudentName with your real name and XX with your section
number .
• Write the program pseudocode (use plain English, not python code) as
comments inside your Python file. You should put # at the start of each line.
• Write your name, section and date on the top of the file as comments.
• After the # symbol, give every step of your design a number so you can refer
to this step later.
• You have to come up with a design that is at least 9 lines (other than your
information on the top of the file).
Your program's design starts out as:
1. Design Prolog - name, section, email, purpose, preconditions,
postconditions
2. In the main function, create a graphics window of size 600*600.
3. Use a for loop to ask the user 15 questions o Inside the for loop.
…
4. Display the user results.
• Once you done, save your work for the next phase.
(100 POINTS) CODING PHASE
Go back to your file that you made in the previous phase and start to inset a
python code between the lines of design you came up with. Your code should
define and use the following function.
• A function called GeneratTwoNumbers that does not take any parameters.
The function generates two integer random numbers and return them back.
• A function called GeneratOperation that does not take any parameters. The
function generates a random integer number between 0 and 1 (0 represents
addition and 1 represents subtraction). Then the program returns it back.
• A function called OperationResult that receives three parameters. The first
two parameters represent the operand of the operation and the third
parameter represents the operation itself. The function calculates the result
of mathematical operation between the two operands and returns back one
result.

• A function called VerifyOperation that receives one integer parameters.
The function verify that the passed parameter is between 0 and 20. The
function returns one Boolean value – True/False-. The function returns
True if the number is between 0 and 20, otherwise it returns False.
• A function called DisplayProblem that receives four parameters. The first
two are the numbers of the problem, the third parameter is the operations
and the fourth parameter represents the window. The function displays the
problem to the user using textboxes. The function also displays an Entry for
the user to input his/her data. After that let the user click on the window,
extract the numerical data inputted by the user and finally returns back this
value.
• A function called InstantFeedback that receives four parameters. The first
two parameters represent the user answer and the real answer of the
problem. The third parameter represents the question number and the fourth
parameter represents the window. The function compare between the two
values and it display a correct message inside a textbox and a green sloid
circle if the answer if correct, or the function displays wrong message
inside a textbox and a red sloid circle if the answer if not correct. The
location of the circle depends on the current question number.
• A function called DisplayStatistics that receives four parameters. The first
parameter represents the number of correct answers, the second parameter
represents the number of wrong answers, and the last parameter represents
the window. The function uses 4 textboxes to show a summary of number
of questions, number of correct answers, number of wrong answers, and
percentage of the correct answers.
Your final program should be as follows:
• Make sure that every variable that you will use will have a proper name
which reflects its task (This name should not be one character).
• Your program must be documented. Use meaningful multi-character
variable names. You must have a header (prolog). Your code appears
between the design steps. Your program must have a main function and call
it to run the program. Your program has NO global code except for the
import statement(s).
• Give your code file the following name “StudentName Section XX lap
Bonus.py”
The function verify that the passed parameter is between 0 and 20. The
function returns one Boolean value – True/False-. The function returns
True if the number is between 0 and 20, otherwise it returns False.
• A function called DisplayProblem that receives four parameters. The first
two are the numbers of the problem, the third parameter is the operations
and the fourth parameter represents the window. The function displays the
problem to the user using textboxes. The function also displays an Entry for
the user to input his/her data. After that let the user click on the window,
extract the numerical data inputted by the user and finally returns back this
value.
• A function called InstantFeedback that receives four parameters. The first
two parameters represent the user answer and the real answer of the
problem. The third parameter represents the question number and the fourth
parameter represents the window. The function compare between the two
values and it display a correct message inside a textbox and a green sloid
circle if the answer if correct, or the function displays wrong message
inside a textbox and a red sloid circle if the answer if not correct. The
location of the circle depends on the current question number.
• A function called DisplayStatistics that receives four parameters. The first
parameter represents the number of correct answers, the second parameter
represents the number of wrong answers, and the last parameter represents
the window. The function uses 4 textboxes to show a summary of number
of questions, number of correct answers, number of wrong answers, and
percentage of the correct answers.
Your final program should be as follows:
• Make sure that every variable that you will use will have a proper name
which reflects its task (This name should not be one character).
• Your program must be documented. Use meaningful multi-character
variable names. You must have a header (prolog). Your code appears
between the design steps. Your program must have a main function and call
it to run the program. Your program has NO global code except for the
import statement(s).
• Give your code file the following name “StudentName Section XX lap
Bonus.py”
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

• Replace the StudentName with your real name and XX with your section
number .
In the bonus, you will make major changes to your original program (Your program
should deal with kids from elementary school, so negative and big numbers are
allowed)). Your program should include the following functions and works as
follows.
• A function that asks the user for his name and the level of difficulty. The
level of difficulty should be either: Easy (numbers consist of 1 digit),
Medium (numbers consist of 2 digits), and Hard (numbers consist of more
than 2 digits up to 6 digits).
• A function that returns back one of the basic four mathematical operations
(addition, subtraction, multiplication and division).
• A function that creates the problem to the user.
• A function that display an image instead of creating red or green circle
SCREENSHOT OF A POSSIBLE OUTPUT OF THE PROGRAM
number .
In the bonus, you will make major changes to your original program (Your program
should deal with kids from elementary school, so negative and big numbers are
allowed)). Your program should include the following functions and works as
follows.
• A function that asks the user for his name and the level of difficulty. The
level of difficulty should be either: Easy (numbers consist of 1 digit),
Medium (numbers consist of 2 digits), and Hard (numbers consist of more
than 2 digits up to 6 digits).
• A function that returns back one of the basic four mathematical operations
(addition, subtraction, multiplication and division).
• A function that creates the problem to the user.
• A function that display an image instead of creating red or green circle
SCREENSHOT OF A POSSIBLE OUTPUT OF THE PROGRAM
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

1 out of 5

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.