subject

Encapsulate the following Python code in a function named my_sqrt that takes a as a parameter, chooses a starting value for x, and returns an estimate of the square root of a. while True:y = (x + a/x) / 2.0if y == x:breakx = yAlso write a function named test_sqrt that prints a table like the following using a while loop, where "diff" is the absolute value of the difference between my_sqrt(a) and math. sqrt(a).a = 1 | my_sqrt(a) = 1 | math. sqrt(a) = 1.0 | diff = 0.0a = 2 | my_sqrt(a) = 1.41421356237 | math. sqrt(a) = 1.41421356237 | diff = 2.22044604925e-16a = 3 | my_sqrt(a) = 1.73205080757 | math. sqrt(a) = 1.73205080757 | diff = 0.0a = 4 | my_sqrt(a) = 2.0 | math. sqrt(a) = 2.0 | diff = 0.0a = 5 | my_sqrt(a) = 2.2360679775 | math. sqrt(a) = 2.2360679775 | diff = 0.0a = 6 | my_sqrt(a) = 2.44948974278 | math. sqrt(a) = 2.44948974278 | diff = 0.0a = 7 | my_sqrt(a) = 2.64575131106 | math. sqrt(a) = 2.64575131106 | diff = 0.0a = 8 | my_sqrt(a) = 2.82842712475 | math. sqrt(a) = 2.82842712475 | diff = 4.4408920985e-16a = 9 | my_sqrt(a) = 3.0 | math. sqrt(a) = 3.0 | diff = 0.0

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:20
It policy compliance and emerging technologies respond to the following: propose at least three control measures that organizations need to put in place to ensure that they remain complaint with emerging technologies and in a continually changing it environment. examine the correlation of effective configuration management and change control procedures to remain compliant with emerging technologies and it security changes.
Answers: 2
question
Computers and Technology, 23.06.2019 00:10
Write a function so that the main0 code below can be replaced by the simpler code that calls function mphandminutes tomiles0. original main0 int main) l double milesperhour-70.0; double minutestraveled = 100.0; double hourstraveled; double milestraveled; hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; cout < "miles" 2 using namespace std; 4 /* your solution goes here/ 6 int maino 1 test passed 7 double milesperhour 70.0 all tests passed 8 double minutestraveled 100.0; 10 cout < < "miles: " < < mphandminutestomiles(milesper-hour, minutestraveled) < < endl; 12 return 0; 13
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
Answer these and get 40 points and brainliest
Answers: 1
question
Computers and Technology, 24.06.2019 23:30
Adrian has decided to subscribe for a new internet connection. he wants a high speed connection so that he can stream video content smoothly. which access technology would you advise adrian against using?
Answers: 1
You know the right answer?
Encapsulate the following Python code in a function named my_sqrt that takes a as a parameter, choos...
Questions
question
Social Studies, 18.09.2020 03:01
question
French, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
History, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Physics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Spanish, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
question
Mathematics, 18.09.2020 03:01
Questions on the website: 13722363