View the step-by-step solution to:

Question

Hi can you solve this question for me using Python 3?


Suppose you are asked to design a

software tool that helps an elementary school

student learn arithmetic operations. The software allows the student to select the arithmetic

operation she or he wishes to study. The student chooses from a menu one of two arithmetic

operations: Addition and Multiplication. Based on the student choice, the software tests the user

with exactly 10 questions. For each question, two random positive one-digit integers are

generated; then the student is asked to enter the answer for the arithmetic operation applied to the

two numbers.

The software displays the number of correct answers and the message "Congratulations!" if more

than 6 questions are answered correctly, otherwise, the program should display "Please ask your

teacher for help".


a) Implement a Python function to execute the arithmetic test for a student for multiplication

or addition operations. The function receives as parameter an integer that represents the

required operation (1 for multiplication and 0 for addition). Then it gets the student to

answer 10 questions as follows:

a. Randomly generates two positive one-digit integers.

b. Ask the student to enter the answer for the arithmetic operation of the two

numbers,

c. Checks if the result is correct. If the answer is incorrect, it provides the correct

answer.

As questions are answered, the correct answers are counted. The number of correct

answers is returned by the function.


b) Implement the main part of the program to interact with the student to obtain the choice

for either multiplication or addition, then call the function developed in part (a) to test the

student (recall that the function returns the number of correct answers). Then print the

number of correct answers, followed by one of two possible messages

("Congratulations!" or "Please ask your teacher for help", depending on whether the

student gets more than 6 correct answers or not).

Top Answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question