Question: python language please! Design and write a Python program that gives and scores a math quiz. The quiz displays 10 random problems, one at a

python language please!  python language please! Design and write a Python program that gives
and scores a math quiz. The quiz displays 10 random problems, one
at a time, using a variety of the arithmetic operators: +,,,11, and
% and reports the score, the number of correct answers for the

Design and write a Python program that gives and scores a math quiz. The quiz displays 10 random problems, one at a time, using a variety of the arithmetic operators: +,,,11, and % and reports the score, the number of correct answers for the quiz. Your program generates a problem for the user to answer in the form of: num1opnum2= and the user then types an answer. For an example of an addition problem: the program generates two random numbers (let's say num 1 is 17 and num 2 is 5), and prints out a statement of the problem as 17+5=. The user enters an answer. The answer is either correct or incorrect. Either way, an appropriate message is printed (Correct/Incorrect) and 1 is added to score if the answer is correct. Then another problem is given and checked, and so on, until ten problems have been given and scored. Your main program can print a menu giving operator choices (as shown in Figure 6.2.1), generate the two random numbers, and call the appropriate function for that operator. Define a function for each of the 5 operators. Use incremental programming techniques and start with just a single function for one of the operators. Example: Menu System. The main program passes the two random numbers to the appropriate function. Each function displays the problem, gets the user input, and determines if the answer is correct or incorrect. If the answer is correct, the function returns a value of 1 , and if incorrect, the function will return a value of 0 . The main program adds that value to the score. After ten problems have been given, the main program prints out the total score of that quiz, and asks the user if she/he wants to take another quiz. The main program keeps giving a quiz as long as the user wants to continue. For division use // and do floor division only. Alternatively, you might consider the following (instead of printing a menu of options): Make a list of the characters for the operators, such as ops =[+,+,]. If you generate a random number between 0 and 4 , you can use that number as an index for the operators list. That is, if the random number is 0 , the element at index 0 of operators is ' + ', so the problem given will be an addition

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!