Lab 9 - Lab Nine [30 points] In this lab you must write one

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 209 – Review – Page 1 of 3 Lab Nine [30 points] In this lab you must write one program/algorithm. Please submit a zip file of the project folder when you turn in your assignment via KS Online. Try to work through the lab on your own, but if you get stuck, ask a neighbor or the instructor for help. Just be sure that you understand everything that you turn in. Input & Output In this lab you must write a program that computes the square root of a number using the Newton-Raphson method. The output of your program must be formatted exactly as in the following examples: Another example of the output is: Please enter the number: 49 Please enter the threshold: 4.1 The square root of 49 is: 7.128 Please enter the number: -49 Please enter the threshold: 4.1 -49 is an invalid input. The input may not be negative.
Background image of page 1

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

View Full DocumentRight Arrow Icon
CIS 209 – Review – Page 2 of 3 The Method The square root of a number can be approximated by the the Newton-Raphson method. The idea is to start with an approximation to the square root, and then iteratively refine
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/29/2011 for the course CIS 209 taught by Professor Aren during the Spring '11 term at Kansas State University.

Page1 / 3

Lab 9 - Lab Nine [30 points] In this lab you must write one

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online