Assignment On Python Program For Kids To Learn Mathematics


Added on  2019-09-25

5 Pages1458 Words185 Views
Math for kindergartenBACKGROUNDIn 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 ofthe 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 - additionor 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 screenin 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 entryfor 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

(0 POINTS)STEP 1:DESIGNHave 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,postconditions2.In the main function, create a graphics window of size 600*600. 3.Use a for loop to ask the user 15 questions oInside the for loop.... 4.Display the user results. Once you done, save your work for the next phase. (100POINTS)CODING PHASEGo back to your file that you made in the previous phase and start to inset apython code between the lines of design you came up with. Your code shoulddefine 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

End of preview

Want to access all the pages? Upload your documents or become a member.