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.
Correct answer will be upvoted else Multiple Downvoted. Computer science. Polycarp has a most loved arrangement a[1… n] comprising of n integers. He worked it out on the whiteboard as follows:    he composed the number a1 to the left side (toward the start of the whiteboard);    he composed the number a2 to the right side (toward the finish of the whiteboard);    then, at that point, as far to the left as could really be expected (yet to the right from a1), he composed the number a3;    then, at that point, as far to the right as could be expected (however to the left from a2), he composed the number a4;    Polycarp kept on going about too, until he worked out the whole succession on the whiteboard.    The start of the outcome appears as though this (obviously, if n≥4).    For instance, assuming n=7 and a=[3,1,4,1,5,9,2], Polycarp will compose a grouping on the whiteboard [3,4,5,2,9,1,1].    You saw the grouping composed on the whiteboard and presently you need to reestablish…

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