Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1: Implement a C++ program that calculates the left-endpoint, right-endpoint, trapezoidal, midpoint, and simpsons rule approximations for a particular definite integral. The program needs

Exercise 1:

Implement a C++ program that calculates the left-endpoint, right-endpoint, trapezoidal, midpoint, and simpsons rule approximations for a particular definite integral. The program needs to have input n from user using cin and needs to display output on screen using cout. As a test case for our numerical integration, we will approximate the definite integral of f (x) = 1/(1+x^2) on the interval [0, 1].

#include #include using namespace std;

int main() { /* a = lower limit; b = upper limit; n = number of intervals */ int n; cin >> n; cout << << endl; return 0; }

Exercise 2:

Implement a C++ program that automatically finds n for trapezoidal rule to achieve given accuracies? What is the smallest value of n that makes the absolute value of the error in trapezoidal rule less than 106? Less than 108? n needs to be started from 1 with step-size of 1 using loop. Branch needs to be used to find the n which gives error less than 10-6 or 10-8 by stopping there when it meets the condition. The program must use variables, branch, loop in a proper way. The program needs to display detailed procedure and output on screen using cout.

#include #include using namespace std;

int main() { string userName; string totalString; cin >> userName; cout << userName <<"'s code" << endl; // Start your programming here! }

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: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

5. Make suggestions for use at home.

Answered: 1 week ago

Question

Develop a program for effectively managing diversity. page 303

Answered: 1 week ago

Question

List the common methods used in selecting human resources. page 239

Answered: 1 week ago