Does the submission include a my-sqrt function

Assignment Help Python Programming
Reference no: EM132883623

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.

Question 1: Does the submission include a my_sqrt function that takes a single argument and includes the while loop from the instructions?

Question 2: Does the my_sqrt function initialize x and return its final value?

Question 3: Does the test_sqrt function print a values from 1 to 25?

Question 4: Does the test_sqrt function print the values returned by my_sqrt for each value of a?

Question 5: Does the test_sqrt function print correct values from math.sqrt for each value of a?

Question 6: Does the test_sqrt function print the absolute value of the differences between my_sqrt and math.sqrt for each value of a?

Question 7: Does the my_sqrt function compute values that are almost identical to math.sqrt ("diff" less than 1e-14)?

Reference no: EM132883623

Questions Cloud

What is the monthly cash receipts schedule for the firm : Sales in January and February were $41,000 and $39,000, respectively. What is the monthly cash receipts schedule for the firm for March through August
Discuss how vulnerabilities can be exploited : Discuss three different vulnerabilities you found in your specific subject area research. Discuss how those vulnerabilities can be exploited
How big data analytics can be used with smart cities : How Big Data analytics can be used with Smart Cities. This is exciting and can provide many benefits to individuals as well as organizations.
Importance of lighting and access control : Refer to your text on the importance of Lighting and Access Control and be sure to cover the salient issues discussed in the text.
Does the submission include a my-sqrt function : Does the submission include a my_sqrt function that takes a single argument and includes the while loop from the instructions?
Information classification schemes : The U.S. government classifies sensitive information into four main categories based on the degree of damage that would occur to national security
How much did the contractor save : The contractor pays 60% of the invoice amount on June 5 and the remainder on June 17. How much did the contractor save
Explain how the nss should incorporate technology to public : Cybersecurity Technologies, What would be your recommendation for how the NSS should incorporate this technology to the public?
Determine the forecast error rate : For each of the months March through June, determine the 3-month forecast error rate, defined as 1 minus the absolute percentage error

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd