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
You have been hired to set up a network for XYZ Enterprises. What factors will you consider to determine the type of network nee
Margarita [4]

Answer:

I would say if it is a multiple choice

Explanation:

q3 or q5 would be the best ones to pick from in my eyes.

3 0
4 years ago
Read 2 more answers
If a person was on board a hypersonic airplane what do you think they would be able to see as they look out a window looking in
kifflom [539]
You would see the clouds around you.

8 0
3 years ago
Read 2 more answers
2. Name the three building blocks of design that pertain to form.
inna [77]

Answer:

Point, Line, Shape,Form, Color, Value, and Texture.

Explanation:

The elements of design, are the building blocks used by the designers to create the designs. ...

Point, Line, Shape,Form, Color, Value, and Texture.

3 0
4 years ago
How do you change brightness on acer laptop?
Vlad1618 [11]
You could Google the model of your laptop to find that out. Also, the brightness sometimes increases when the laptop has a charger plugged in.
6 0
4 years ago
After a break, always review your work to
Anettt [7]
Double check that you got the right answer now that your mid is stress free and relaxed to focus 
6 0
4 years ago
Read 2 more answers
Other questions:
  • Laura would like to include additional text that is related to the document but not contained within the document.
    13·2 answers
  • 1. How do you answer questions that require you to draw inferences? (1 point)
    7·2 answers
  • A species of snake lives in a rainforest. Which would be an adaptation for this
    10·2 answers
  • How many possible mac addresses are there?
    5·1 answer
  • In the ____, or ad hoc, layouts configuration, there is no access point at the center of a cell.
    7·1 answer
  • What is grid computing? It is distributed computing where autonomous computers perform independent tasks. It is interconnected c
    12·1 answer
  • The most common Unicode transformation formats are UTF- ______ and UTF-16.
    9·1 answer
  • help help help help help help help help help help help help help help help help help help help help help help help​
    7·2 answers
  • 1 #include 2 3 int max2(int x, int y) { 4 int result = y; 5 if (x &gt; y) { 6 result = x; 7 } 8 return result; 9 } 10 11 int max
    12·1 answer
  • Where is the option to set Conditional Formatting rules found?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!