Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to write a program that calculates the integral of a x^n function. The in

ID: 3643564 • Letter: I

Question

I need to write a program that calculates the integral of a x^n function. The integral of x^n is ((x^(n+1))/(n+1)) + C; 'n' can't be = -1. The program should ask the user for the grade of the polinomial ('n') and then ask for the coefficient of x for every grade (including 'n'). For example if the user enters n = 2 then the program should ask the user for the coefficient of x^2, x^1 and x^0, calculate the integral and the display the result.

|||| Example: |||||
Enter n: 3
coefficient of grade 3: 1
coefficient of grade 2: 3
coefficient of grade 1: 0
coefficient of grade 0: 5
complete function: x^3 + 3x^2 + 5 <---- don't have to show this in the program
integral: .25x^4 + x^3 + 5x <--- last output

Explanation / Answer

#include using namespace std; void main(){ int n=0; int grade[30]; do{ coutn; if(n==-1) cout