I am trying to calculate the area under the curve but im not sure what im doing
ID: 441473 • Letter: I
Question
I am trying to calculate the area under the curve but im not sure what im doing wrong #include #include using namespace std; int main() {// begin main double a;// starting point double b;// ending point double x;// variable double w = 0.01;// width double areaUnderCurve;// area under the curve double functionOfCurve;// function of the curve cout << "Welcome, to calculate the area under the curve" << endl; cout << "please enter a(starting point) and b(ending point)" << endl; cout << "in which b must be greater or equal to a" << endl; cout << " Please enter a " << endl; cin >> a ; cout << " Please enter b " << endl; cin >> b ; if (a >= 0 && b >= 0 && b>= a)// checks conditions before beginning {// begin if statement for(w = 0.01; w <= x; w++) {// begin for loop do {//begin do loop functionOfCurve = (10* pow(x, 3)) + (24* pow(x, 2)) - (3*x) + 8; areaUnderCurve = w * functionOfCurve; cout << "The area under the curve is " << areaUnderCurve << endl; }//end do loop while( x <= b);// the program will continue as long as this condition is met x = a + w++; }// end for loop }// end if statements else // if statement is not met then an error message will proceed {// begin else loop cout << " ERROR. Please enter any key to terminate program" << endl; }// end of else loopExplanation / Answer
the image and equations are not readable
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.