1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vovikov84 [41]
3 years ago
7

Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This

function expects the input number as an argument and returns the estimate of its square root. The script should also include a main function that allows the user to compute square roots of inputs until she presses the enter/return key
Computers and Technology
1 answer:
Shtirlitz [24]3 years ago
7 0

Answer:

def newton(n):

       #Define the variables.

       t = 0.000001

       esti = 1.0

       #Calculate the square root

       #using newton method.

       while True:

               esti = (esti + n / esti) / 2

               dif = abs(n - esti ** 2)

               if dif <= t:

                       break

   

       #Return the result.

       return esti

#Define the main function.

def main():

   

       #Continue until user press enters.

       while True:

               try:

         

                       #Prompt the user for input.

                       n = int(input("Enter a number (Press Enter to stop):"))

                       #display the results.

                       print("newton = %0.15f" % newton(n))

     

               except:

                       return

#Call the main function.

main()

You might be interested in
If you had an idea for a new software company, what would be the best approach to help make it a successful business? develop a
Klio2033 [76]

Answer:

develop a business plan to describe how to maintain and grow revenues

Explanation:

4 0
3 years ago
Read 2 more answers
While the Internet can be a great resource, the information is not always reliable, as anyone can post information. Select one:
Olin [163]

Answer: True

Explanation: Because anyone can post something and it can be non reliable

7 0
3 years ago
What are the advantages and disadvantages of the simulated link strategy?
amid [387]

Answer:

The advantage of the simulated link strategy are:

  • It is easily able to provide the practical feedback to the customers and users while designing the whole system. It also determine the efficiency and the correctness of the design in the stimulated link strategy.
  • In the stimulated link strategy, the sharing and delivering of the data and information is done efficiently without any occurrence of error and interrupt. It is also high flexible technique.

The disadvantage of the simulated link strategy are:

  •   The simulated link strategy is flexible but it is not standardization and also it required more good concept.
  •  This technique is expensive and it is not readily available as it always require validation process.

3 0
3 years ago
Lisa granted the CREATE TABLE privilege WITH ADMIN OPTION to Sharon. Sharon granted the privilege to Bob. If Lisa’s privileges a
GuDViN [60]

Answer:

D

Explanation:

As it's not fair if they all lose there privileges

4 0
3 years ago
In this unit, you learned how to manipulate numbers and strings, acquire input from the user, perform data manipulations for var
e-lub [12.9K]

Answer:

Sometimes you will tell the CPU to use the main memory, secondary memory, network, or the input/output devices. Digital Computing: It's All ...

4 0
3 years ago
Other questions:
  • Write a function named delete Letter that has 2 parameters. The first parameter is a string, the second parameter is an integer.
    11·1 answer
  • Shut down and unplug the computer. Remove the CPU case lid. Locate the various fans, and then use
    11·1 answer
  • What is cpu????????????????????????????
    12·2 answers
  • Suppose your SOHO network connects to the Internet using cable modem. When you open your browser and try to access a web site, y
    8·1 answer
  • Which branch of science helps avoid or minimize stress related injuries at workplace? _____ is a branch of science that aims to
    15·1 answer
  • . Describe a way to simplify a complex problem.
    8·1 answer
  • What are the three control statements in Qbasic?​
    10·1 answer
  • Software that displays advertising material when online.
    12·2 answers
  • When looking at aggregated logs, you are seeing a large percentage of Windows hosts connecting to an Internet Protocol (IP) addr
    5·1 answer
  • 6. kinukuha nito ang kabuuang bilang ng mga numerical na datos sa mga piniling cells
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!