answer.
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]
2 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]2 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
Mary has been locked out of her account after failing to correctly enter her password three times. As the system administrator,
Digiron [165]
Oh hey lol yea yea lol I got the money back to me put on the phone so you know
7 0
2 years ago
Ben uses a table that has few columns. He knows about a particular value in the first column and wants to find the corresponding
igor_vitrenko [27]
I'd suggest he uses LOOKUP Function.

You can use the LOOKUP function when you need to look in a single column or row and find a value from the same position in a corresponding column or row. We have a much improved VLOOKUP that can also be used to search one row or column or multiple rows and columns.



4 0
2 years ago
Read 2 more answers
Put the steps in order to produce the output shown below. Assume the indenting will be correct in the program.
V125BC [204]

Answer:

I took a screenshot of the test withe that question

Explanation:

7 0
2 years ago
Publication of flaws in encryption used for copy protection is a potential violation of: A. HIPAA B. U.S. Commerce Department re
djyliett [7]

Answer:

Option C (DMCA) would be the correct choice.

Explanation:

  • DMCA is designed to govern electronic channels and tackle the problems the online revolution confronts regarding copyright.
  • DMCA's mission seems to be to accommodate the rights of intellectual property producers and investors and investigate anything other than a copyrighted material that really occurs throughout the digital environment.

The other given choice are not related to the given content. So that option C is the right one.

6 0
2 years ago
On the attendance worksheet, in cell l5, enter an if function to determine if the percentage in cell k5 is greater than or equal
KatRina [158]

=if(c5≥h18,(c5),(k5))

we will use if function to check the validity of function

we will first write the condition and then we will write the value if condition goes true otherwise if condition does not go true we will write false and function will return value in  k5 cell which we have provided in the formula.

8 0
2 years ago
Read 2 more answers
Other questions:
  • A(n) _____ is the highest educational degree available at a community college. master bachelor associate specialist
    13·2 answers
  • A two-dimensional array can have elements of ________ data type(s).
    7·1 answer
  • An online game is played with two dice. In this context, explain what is meant by decomposition in a simple way.
    15·1 answer
  • Edria was faced with a situation in which she was given sensitive information about twenty different clients, including their so
    13·2 answers
  • 1A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The
    5·1 answer
  • Write a generator function named count_seq that doesn't take any parameters and generates a sequence that starts like this: 2, 1
    5·1 answer
  • You are using a polynomial time 2-approximation algorithm to find a tour t for the metric traveling salesman problem. Which of t
    7·1 answer
  • Python
    9·1 answer
  • Describe the indicators and hazards of a metal deck roof fire in an unprotected steel joist warehouse as well as the techniques
    6·1 answer
  • c Assign to maxSum the max of (numA, numB) PLUS the max of (numY, numZ). Use just one statement. Hint: Call FindMax() twice in a
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!