Computers and Technology
Computers and Technology, 13.10.2020 01:01, JeroMii

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.0
a = 2 | my_sqrt(a) = 1.41421356237 | math. sqrt(a) = 1.41421356237 | diff = 2.22044604925e-16
a = 3 | my_sqrt(a) = 1.73205080757 | math. sqrt(a) = 1.73205080757 | diff = 0.0
a = 4 | my_sqrt(a) = 2.0 | math. sqrt(a) = 2.0 | diff = 0.0
a = 5 | my_sqrt(a) = 2.2360679775 | math. sqrt(a) = 2.2360679775 | diff = 0.0
a = 6 | my_sqrt(a) = 2.44948974278 | math. sqrt(a) = 2.44948974278 | diff = 0.0
a = 7 | my_sqrt(a) = 2.64575131106 | math. sqrt(a) = 2.64575131106 | diff = 0.0
a = 8 | my_sqrt(a) = 2.82842712475 | math. sqrt(a) = 2.82842712475 | diff = 4.4408920985e-16
a = 9 | my_sqrt(a) = 3.0 | math. sqrt(a) = 3.0 | diff = 0.0

Modify your program so that it outputs lines for a values from 1 to 25 instead of just 1 to 9.

You should submit a script file and a plain text output file (.txt) that contains the test output. Multiple file uploads are permitted.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:00, chuchi24
Robots with telescoping arms are sometimes used to perform tasks (e. g., welding or placing screws) where access may be difficult for other robotic types. during a test run, a robot arm is programmed to extend according to the relationship r = 3 + 0.5cos(4θ) and the arm rotates according to the relationship θ=−π4t2+πt , where r is in feet, θ is in radians, and t is in seconds. use a computer program to plot the path of tip a in x and y coordinates for 0 ≤ t ≤ 4s.
Answers: 2
image
Computers and Technology, 22.06.2019 15:00, miracle9704
Atool that matches persoal skills qualities interests and talets to a career is called a
Answers: 1
image
Computers and Technology, 22.06.2019 15:30, tfornwalt4390
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
image
Computers and Technology, 23.06.2019 02:30, jalaholmes2027
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
Do you know the correct answer?
Write a function named test_sqrt that prints a table like the following using a while loop, where "d...

Questions in other subjects:

Konu
Mathematics, 10.12.2020 01:00
Konu
Mathematics, 10.12.2020 01:00