Question: Please help I have trouble getting my Riemann Sum program to work in Python. Also, how do I continue to get my program to output

Please help I have trouble getting my Riemann Sum program to work in Python. Also, how do I continue to get my program to output the sum of the right endpoints and midpoints? Thank you

Please help I have trouble getting my Riemann Sum program to work

1 import numpy 2 import math 3 print("This program calculates the Riemann sum of a quadratic polynomial over an interval and uniform subintervals all of the user's choosing.") Riem 4 userchoice = 'Y' = User Choice 5 while userchoice = 'N' and userchoice = 'n'; # Print the current value of count print("The quadractic equation is a*x**2 + bx + C = 0. Please input your integer value for each quadratic function below.") a = float(input("Please input the first coefficient: ")) *variable assignment to later input b float(input("Please input the second coefficient: ")) c = float(input("Please input the third coefficient: ")) d = input("Please give the first number of the interval to find the area under the curve: ") The user inputs the value of interval d e = input("Please give the second number of the interval to find the area under the curve: ") The user inputs the value of intervale interval - ( , {}]" .format(d,e)) #The whole interval print("The interval is (}.".Format(interval)) subintervals = input("Please tell how many subintervals the interval has:") The user inputs how many subintervals are in the interval print("There are t) subintervals..format(subintervals)) x = d quad_equation - ax**2 + bx + C quadratic equation while xe: sum_ - f(d) (dex) sum_1 - f(. dx)*(*x) entry - input('Would you like to rerun the program? Please enter "Y" to continue or "N" to quit:') if entry = 'Y' or entry "y": print() - Check for bad entry elif entry I 'N or entry i n ': print(" + entry + " is not a valid choice') else must be of 'n

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!