Question: LANGUAGE : Python 3 Objective: Practice using looping and the math module with user input. Description: Compute the square root of a number specified by

 LANGUAGE : Python 3 Objective: Practice using looping and the math

LANGUAGE : Python 3

Objective: Practice using looping and the math module with user input. Description: Compute the square root of a number specified by the user using Newton's method for some number of iterations and examine the convergence. Your program must meet the following requirements: 1. Include a multi-line comments at the top of the file with your name, student ID number, course number, and the assignment number. 2. Your program should ask the user for a number as a float. To avoid errors, it should ensure that the value is not negative. 3. It should use the input value to compute the square root using Newton's method and show the results for 1, 2, 4, 8, 16, and 32 steps, as well as the "correct result using math.sqrt(). Hint: Test your code with several values and build up the solution one step at a time. Deadline: Saturday, February 8, 2020, noon (try to finish in class) Example Output: The following is a possible run with example of inputs. Please enter a number: 4321 Steps = Value === ===== ==== === ===== === ===== ==== ==== === = 1 = 1211.8920313790256 = 607.7287652613055 = 160.7375691022556 = 65.73443461354964 = 65.73431371817918 32 = 65.73431371817918 sqrt = 65.73431371817918 ==== ===== === ===== === ===== ==== ==== ===== == Thank you, Good Bye

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!