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
There are six different sequences for the three approval tasks: check inventory; check credit; check special terms.
Lana71 [14]

Answer:

i dont know i am 13

Explanation:

3 0
4 years ago
Consider a computer with two processes, H, with high priority, and L, with low priority. The scheduling rules are such that H is
marishachu [46]

Answer:

No

Explanation:

We know that Priority inversion can be seen as a scheduling situation in which higher priority task gets preempted by lower priority task. And that this is one of the main problem in priority scheduling.

If we overlook Priority scheduling and instead we decided to use Round Robin scheduling we will never encounter the priority inversion problem. As ,in Round Robin scheduling the process generally use a certain amount of time or time slices for each processes before it is force to wait for the next process.

3 0
4 years ago
Jill uses Word to create an order form. She starts out by creating a table that has three columns and ten rows. She would like h
noname [10]

Answer: Jill will have to b) merge the top three cells so that her first heading can span the width of the entire table.

Explanation: If Jill merges the top two cells, one of the cells will still remain and therefore she will not be able to span the width of the entire table. She cannot merge the top ten cells because the problem states the has 3 columns. The 10 rows occupy the entire table and are not located at the top of the table. Jill could widen the first cell, however, it will limit her table to one large column and 10 rows. The problem states that only the first heading or row should be occupying the entire width, therefore b) merges the top three cells is the correct answer.

3 0
3 years ago
PLEASE HELP ME WITH THIS QUESTION:
Darina [25.2K]
There’s literally no question here
5 0
3 years ago
Which gauge indicates the total number of miles your car has been driven since it was manufactured? A. The speedometer B. The ta
In-s [12.5K]
The answer is C. The odometer

<span />
6 0
3 years ago
Read 2 more answers
Other questions:
  • No workplace is immune to the threat of workplace violence. true or false
    9·2 answers
  • Use the get_seconds function to work out the amount of seconds in 2 hours and 30 minutes, then add this number to the amount of
    13·1 answer
  • When a member function is defined outside of the class declaration, the function name must be qualified with theWhen a member fu
    14·1 answer
  • Write a function strlen_recursive which accepts a pointer to a string and recursively counts the number of characters in the pro
    6·1 answer
  • During the Inspect and Adapt event, how are reflection, data collection, problem solving, and identification of improvement acti
    5·1 answer
  • Maximum number of character symbols represented by Unicode
    6·1 answer
  • Identify the programming language released by
    10·1 answer
  • NEED HELP! BRAINLIEST FOR WHOEVER ANSWERS CORRECTLY FIRST!!!
    14·1 answer
  • Cho lược đồ CSDL “Quản lý BÁN HÀNG” có các bảng như bên dưới. (Thuộc tính in đậm và
    7·1 answer
  • When viewing an e-book section of an assignment in launchpad, you can return to your main course page at any time by clicking th
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!