C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
bartleby

Videos

Textbook Question
Book Icon
Chapter 5.7, Problem 5E

Numerical analysis) Given a number, n, and an approximation for its square root, a closer approximation of the actual square root can be found by using this formula:

n e w   a p p r o x i m a t i o n = ( n / p r e v i o u s   a p p r o x i m a t i o n ) + p r e v i o u s   a p p r o x i m a t i o n 2

Using this information, write a C++ program that prompts the user for a number and an initial guess at its square root. Using this input data, your program should calculate an approximation of the square root that’s accurate to 0.00001. (Hint: Stop the loop when the difference between the two approximations is less than 0.00001.)

Blurred answer
Students have asked these similar questions
Find the closed-form equation of T(n)=*** using substitution  example questions: T(n)=T(n/5)+T(7/10n)+n
Analyze the running time (i.e. T(n)) of these functions. You should be able to find some simple function f(n) such that T(n) O(f(n)). You should show your work and rigorously justify your an- 1. swer.
For any integer n > 0, n! is defined as the product n * n - 1 * n - 2 ... * 2 * 1 0! is defined to be 1. It is sometimes useful to have a closed- form definition instead; for this purpose, an approximation can be used. R. W. Gosper proposed the following such approximation formula:

Chapter 5 Solutions

C++ for Engineers and Scientists

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License