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]
4 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]4 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
WILL GIVE MORE POINTS, PLEASE HELP!!!
Karo-lina-s [1.5K]
Right 4 down 5 right 8 !!!!!!!!!
5 0
3 years ago
Hardware is defined as the physical parts of a computer.
love history [14]

Answer:

Computer hardware includes the physical parts of a computer, such as the case, central processing unit (CPU), monitor, mouse, keyboard, computer data storage, graphics card, sound card, speakers and motherboard.

3 0
3 years ago
Read 2 more answers
What is stand-alone LDAP server?
FinnZ [79.3K]

Answer:

A stand-alone LDAP server is defined as to remove the load from a server that does multi function tasks. It is more efficient when we use one or more LDAP configurations .

Light weight Directory Access Protocol (LDAP) is a client and server protocol used for accessing directory data. It  helps in reading and editing the directories over IP networks and runs directly over Transmission control protocol and internet protocol used simple string format for transferring of data.

8 0
3 years ago
When you listen to a guitar duet and have trouble hearing the melody, which of the following would best explain the problem?
emmasim [6.3K]

Answer:

One of the guitarists is playing too loud.

Explanation:

My dad plays the guitar...?

I'm shocked it's not "not keeping a steady beat", so I'm certain this is it.

3 0
3 years ago
Read 2 more answers
Which of the following is not an impact device?<br> Joy Stick<br> Track Ball<br> Mouse<br> Printer
likoan [24]
A joystick is not an impact device.
3 0
3 years ago
Other questions:
  • What is an audit trial
    8·1 answer
  • To close a window in Windows 10, you can _____. Select all that apply. A. right-click its button on the taskbar, then click Clos
    11·1 answer
  • Contextual targeting method mean
    11·1 answer
  • If the force of gravity _ then the weight of an object will _
    8·2 answers
  • People who score high on the Big Five trait dimension of ________ tend to use more adjectives in their e-mail communications. Gr
    15·1 answer
  • System inputs and outputs are produced at the end of the: A. systems analysis phase of the SDLC. B. systems planning and selecti
    12·1 answer
  • Write the definition of a method named add that receives a reference to a Scanner object associated with a stream of input consi
    13·1 answer
  • Gmod how to make someone admin on a lan server
    6·2 answers
  • State and give reason, if the following variables are valid/invalid:
    12·1 answer
  • To edit the color of the text in Word Online, choose the Font color command under what tab?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!