Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 ByeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started