subject
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.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 13:30, holyturnley
Hola, me podrian resolver estos ejercicios en php? ejercicio1: crear una pagina que permita realizar una conversion monteria: nuevos soles, dolares, euros. se debe seleccionar el valor monetario origen y conversion asi como tambien el monto a convertir ejercicio2: crear un pagina que muestre la tabla de sumar de un rango de numeros ingresados por teclado. ejercicio3: ingresar una palabra y mostrar la escritura del final al inicio ejercicio4: ingresar la fecha de nacimiento de una persona y determinar, cuantos años, meses y dias tiene ejercicio5: ingresar un rango de valor numerico y mostrar, los numeros pares, impares y primos.
Answers: 1
image
Computers and Technology, 21.06.2019 18:40, Maelynne8515
Access defaults to searching for information on the
Answers: 1
image
Computers and Technology, 22.06.2019 19:20, ChaosMind
Write a program that reads a file consisting of students’ test scores in the range 0–200. it should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
image
Computers and Technology, 22.06.2019 20:00, serellehunt
Which type of file can be used to import data into a spreadsheet?
Answers: 1
You know the right 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, 19.07.2019 06:30
Konu
Social Studies, 19.07.2019 06:30