# lab14a - In your comments it's appropriate to note that you...

This preview shows pages 1–2. Sign up to view the full content.

// In your comments, it's appropriate to note that you are modifying an existing // program, note where you got the original program (a URL would be acceptable), // and give me credit as the original author. // Programmer: Doug Hogan // Section: N/A // Program: Lab 14 Partial Solution // Date: July 29, 2008 // Description: This program is a partial implementation of Bisection Method, // Algorithm 2.1, p. 49, Burden/Faires Numerical Analysis text // // Goal: Find a solution to f(x) = 0 given continuous function f // on interval [a,b], where f(a) and f(b) have opposite signs // // Example function used : f(x) = x^3 + 4x^2 - 10 = 0; root in [1,2] #include <iostream> #include <math.h> using namespace std; const double TOLERANCE = 0.0001; // maximum amount of error allowed in an approximation const int MAX_ITERATIONS = 20; // maximum number of iterations to allow int main() { double zero = RootByBisection(1.0, 2.0); cout << endl << "Root found at: " << zero << endl; return 0; } double f(double x)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}