I am attempting to write a loop that will use rudimentary methods to solve an integral (as in the area under a curve) to a certain user-specified degree of accuracy by calculating the area of a changing number of rectangles that fit along that curve. This is the code I have so far:

Given a polynomial y=5x^5+x^4+2x^3-7x^2+x+2, and the start and end points 1, 5, the user inputs are:
x5=5, x4=1, x3=2, x2=-7, x=1, c=2, s=1, e=5, and...