Laboratory Assignment 1 - Due June 22, 1999
The Newton-Raphson Method
We will discuss in class the method for finding roots of equations
called the Newton-Raphson method. Your programming assignment is to write
a simple
program which will implement this method for finding roots of numbers.
The iterative formula in the Newton-Raphson method is
Specifications of the program : Your program must do the
following.
- Prompt the user to input two real numbers, a and b.
- Verify that these numbers are greater than 1. Your program should
inform the user they have made an error if they attempt to input a
number smaller than or equal to 1.
- Prompt the user for a tolerance, tol.
- Implement the Newton-Raphson method to find the
bth root of
a with
a tolerance of tol.
Output of your program : Your program must output four things.
The numbers a, b, and the result of the program, i.e. the
bth
root of
a, and the tolerance tol identifying
each to the user. Do not worry at this point about how many decimal points
are printed out. We will discuss later ways of formatting output.
Keith Lynn
Fri Jun 11 15:04:19 CDT 1999