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
patriot [66]
3 years ago
7

Convert Newton’s method for approximating square roots in Project 1 to a recursive function named newton. (Hint: The estimate of

the square root should be passed as a second argument to the function.) An example of the program
Computers and Technology
1 answer:
PIT_PIT [208]3 years ago
3 0

Answer:

import math

tolerance=0.00001

approximation=1.0

x = float(input("Enter a positive number: "))

def newton(number,approximation):

   approximation=(approximation+number/approximation)/2

   difference_value =abs(number-approximation**2)

   if difference_value<= tolerance:

       return approximation

   else:

       return newton(number,approximation)

print("The approximation of program = ", newton(x, approximation))

print("The approximation of Python = ", math.sqrt(x))

Explanation:    

  • Create a recursive function called newton that calls itself again and again to approximate square root for the newton technique.
  • Apply the formulas to find the estimate value  and the difference value .
  • Check whether the difference_value is less than the tolerance value  and then return the value of approximation  else make a recursive call to the newton function by passing the  user input and the new approximation value .
  • Finally display all the results using the print statement.
You might be interested in
What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
Ainat [17]

Answer: Even though the hardware is inexpensive the writing of program is not efficient through this method as proper development of program is necessary for the clear execution due to factors like:-

  • The facility of writing program even the cost of hardware is less but it is not a free facility.
  • It also has a slower processing for the execution of the program
  • The construction of the efficient program is necessary for the compilation and execution of it rather than poorly constructed program is worthless and inefficient in working.

7 0
3 years ago
A typical, small, dry cell battery has a voltage of A. 6.0 volts. B. 1.0 volts. C. 12.0 volts. D. 1.5 volts.
Bad White [126]
The answer is D 1.5 volts
6 0
3 years ago
Read 2 more answers
You have purchased a used computer from a computer liquidator. When you boot the computer, you find that there has been a passwo
Sergio039 [100]

Answer:

What you should do is to move the motherboard jumper.

Explanation:

Based on the information given in a situation where you boot the computer system in which you find out that there was a password set on the BIOS which full meaning is BASIC INPUT/OUT SYSTEM which means that if You need to clear the set password in order for you to edit the CMOS settings which full meaning is COMPLEMENTARY METAL OXIDE SEMICONDUCTOR What you should do is for you to move the MOTHERBOARD JUMPERS reason been that jumpers will help to set or configure the MOTHERBOARD which is the most important part of a computer and the brain of a computer in order to clear the password so that CMOS setting can be edited.

5 0
3 years ago
"When a large data file needs to be processed in ascending or descending order based on a particular field, the most efficient a
Alona [7]

Answer:

Yes

Explanation:

For example, We need to write down the names of student in a school for survey purposes, rather than tell everyone to write their names on a sheet of paper and submit, we can instruct that names be written according to their classes and then written on the class sheets alphabetically.

Logically names will be written according to the classes from Class 1 - 10, then on the class sheet alphabetically from A - Z. its better represented that way for easy understanding and better collation and interpretation of data.

7 0
4 years ago
A technician is troubleshooting a computer that will not communicate with any hosts on the local network. While performing a vis
tangare [24]

Answer:

Assuming that D is correct, the other answer is C.

Explanation:

<em>I used Dell Support to confirm this.</em>

It states that if the lights are off, it is not detecting the network and no connection is in place. You would want to confirm the NIC is enabled in the BIOS (as C states).

I hope this helps!

8 0
3 years ago
Other questions:
  • 8. Which of the following must a designer be aware of when planning the design of a document?
    10·1 answer
  • Explain how you give users keyboard access to a text box
    6·1 answer
  • Each processor or core processes two threads at the same time is called _________.
    5·1 answer
  • How to cite a website, like asha.org?
    6·1 answer
  • You are creating a database for your computer club. Most of the students live in your town, Durham. How can you make Durham appe
    11·1 answer
  • What is the statement describing? Agile team continuously adapt to new circumstances and enhance the methods of value delivery
    6·1 answer
  • How do you implement instruction level parallelism
    11·1 answer
  • The___ is usually the lead in a team of photographers.
    12·2 answers
  • Write a definition in your own words for Raster Graphic. Do not copy and paste please.
    12·1 answer
  • Which is a guideline for conducting technical reviews?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!