Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this programming assignment. I'm confused with the functions get_user_response and validate_response. Any help would be great! Goal To write a program

I need help with this programming assignment. I'm confused with the functions get_user_response and validate_response. Any help would be great!image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Goal To write a program in Python to test the user's ability to do arithmetic operations on fractions, and award points on correct attempts Description The program will have one or more rounds, depending on whether the user decides to continue or not at the end of each round. During each round, the program will ask the user to enter the numerator and the denominator of the correct answer for an arithmetic operation involving fractions. These fractions, as well as the specific operation itself (one of the following four: addition, subtraction, multiplication, and division) should be generated/chosen randomly. These fractions (operands) will always be positive, however, please note that, the result might not be always positive (Note: You do NOT need to reduce any of the fractions in this program to their lowest terms). The operand fractions should always have a value less or equal to 1 when reduced (which means the numerator of a fraction cannot be greater than the corresponding denominator). The range of values for the numerators of the fractions are determined by the difficulty level chosen by the user (1, 2, or 3) at the beginning of each round. Level 1 restricts the denominators to [1,5], level 2 restricts the denominators to [6,10], and level 3 restricts the denominators to [11,15]. Any other value for the difficulty level entered by the user should be consideredinvalid andthe user should be asked to re- enter the difficulty level. Once a problem (two numerators, two denominators and the arithmetic operation to be performed on them) is generated, the user is shown the problem and asked to enter the numerator and the denominator of the estimated result (if the result is negative, enter a negative numerator and positive denominator). If both of the entered values are correct (matches the correct numerator and denominator), the user gains points

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Define the nature of interviews

Answered: 1 week ago