Question: PYTHON ONLY!! Write a program to allow a user to practice addition or multiplication. The program should use at least four functions. This function will
PYTHON ONLY!!
Write a program to allow a user to practice addition or multiplication. The program should use at least four functions.
This function will print an introduction to the program.
This function will accept 2 integer parameters and present an addition problem with these numbers.
This function will accept 2 integer parameters and present a multiplication problem with these numbers.
This function will accept 2 integer parameters representing the user's answer and the correct answer. It will check to see if the answer is correct and print a message. If the parameters are equal the function should return True; otherwise it should return False.
The program should allow the user to input their choice for either addition problems (enter +) or multiplication problems (enter x). The user should also enter how many problems they wish to solve and how many tries they will have to answer correctly. If the input is: (input on left -- description on right) x # Choice of + or x 3 # 3 problems 4 #4 tries to get correct 1 # Number 1 in the problem 1 2 #Number 2 in the problem 1 3 #Solution 1 4 #Solution 2 2 #Solution 3 is correct 4 #Number 1 in problem 2 5 #Number 2 in problem 2 20 #Solution 1 is correct 8 #Number 1 in problem 3 7 #Number 2 in problem 3 5 #Solution 1 4 #Solution 2 11 #Solution 3 2 #Solution 4 The output should be: This program would allow the user to select multiplication or addition problems You can also select hom many problems you want and the number of times you can try to get a correct solution Enter + for addition or x for multiplication How many problems?3 How many attempts to answer correctly?4 Problem 1 1 x 2 = 3 No, incorrect 1 x 2 = 4 No, incorrect 1 x 2 = 2 Correct! Problem 2 4 x 5 = 20 Correct! Problem 3 8 x 7 = 5 No, incorrect 8 x 7 = 4 No, incorrect 8 x 7 = 11 No, incorrect 8 x 7 = 2 No, incorrect The correct answer is 56
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
