Write a program that inputs an integer for n

Assignment Help Computer Engineering
Reference no: EM13322843

Square Root <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
The Babylonian algorithm to compute the square root of a number n is as follows:

1. Make a guess at the answer (you can pick n/2 as your initial guess).

2. Compute r = n / guess

3. Set guess = (guess +r) / 2

4. Go back to step 2 for as many iterations as necessary. The more that steps 2 and 3 are repeated, the closer guess will become to the square root of n.

Write a program that inputs an integer for n, iterates through the Babylonian algorithm twenty times, and outputs the answer as a double to two decimal places. Your answer will be most accurate for small values of n.

 

Reference no: EM13322843

Questions Cloud

Write a void function definition for a function : Write a void function definition for a function called add_tax. The function add_tax has two formal parameters taxrate.
Write a function declaration and function definition : Write a function declaration and function definition for a function which allows the user to input an argument of type double.
Write a program that simulates the roll of two dice : Write a program that simulates the roll of two dice using the random number generators. You will call the rand () function once for each dice. Each rand() call will return a number between 1 and 6.
What is the index of refraction of the reflecting material : The angle of incidence of a light beam in air onto a reflecting surface is continuously variable. What is the index of refraction of the reflecting material
Write a program that inputs an integer for n : Write a program that inputs an integer for n, iterates through the Babylonian algorithm twenty times, and outputs the answer as a double to two decimal places. Your answer will be most accurate for small values of n.
Find the intensity of the beam : The polarizers are rotated, so that the second polarizer has a transmission of 43.6 degrees with respect to the first polarizer, find the intensity of the beam
State a reaction mechanism for the chlorination of 1-butene : Write a reaction mechanism for the chlorination of 1-butene by Cl2. Use curved arrows to show electron movement. Show structures of key reaction intermediates and products and indicate the stereochemistry of the reaction.
Find the current induced in the coil : A strong electromagnet produces a uniform magnetic field of 1.60 T over a cross-sectional area of 0.260 m2. What is the current induced in the coil
The stereoselectivity and regioselectivity of the reaction : 2-iodo-4-methylpentane was refluxed for an hour in the presence of sodium isopropoxide. Name and draw the product(s) of this reaction clearly showing the stereoselectivity and regioselectivity of the reaction.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Disadvantages of using multiple models

offer two common failures in moving a system from development into production status.

  How we can implement a cardiac machine simulator in c++

Keep track of the bug location; which could be an index into the memory array. Watch out for cells 0 and 99; they are special. Read the input tape from a file that starts with a number telling you how various items are on the tape.

  Define how the lack of metrics for measuring

define how the lack of metrics for measuring certain software properties affects the software engineering discipline.

  Write down a new program in pseudo-code

desplay what PC monitor will display when values 86, 55, and 100 are used.

  Reviewing and reporting microsoft security procedures

For every operating system, review the securities procedure involving, password protection, user account setting, files and folders privacy, and the network protection (this may not be a part of the operating system)

  Designing an erd

xplain why all this normalization stuff is so significant?" he asks. "The old system worked “OK” most of time, and now you're telling me we require all these special rules. Why is this essential?" Develop the ERD in MS Visio.

  Develop an application with the chosen dbms

A school intends to procure the integrated student management application holding all details of registered students including personal information, courses taken, and examination grades.

  The application must have at least one class

A salesperson can also receive a commission as a sales incentive. Commission is a percentage of the salesperson's annual sales. The current commission is 5 percentof total sales.

  What is the sql

Recently AMI has been experiencing significant downtime because of  a failing software application written for AMI when the company started. This Access database application is responsible for a main manufacturing process.

  Implementing the wilkerson-irwin algorithm

Write down a program in order to implement the Wilkerson-Irwin algorithm to minimize mean tardiness.

  How each diagram relates to the solution

Your submission should include 6 to 8 pages of Visio developed UML diagrams (minimum of six different ones), hierarchy chart, and flowcharts; copy/paste into a MS Word document that also contains the pseudo code and data dictionary for the solutio..

  Providing overview of lane

Describe in scholarly detail an overview of the LANE and explain its place in an organization's network strategy. Answer should be of 300 words and also provide reference.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd