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 program that fills two lists with input from the use

Write a program that fills two lists with input from the user. One list should be students' first names and the second list should be students' last names.

  What is the value of y after the following code is executed

Which is the statement that declares and initialises with zero a two dimensional array variable m with 3 rows and 4 columns?

  Write a program to convert kilometers to miles

Write a program to convert kilometers to miles. Define a function convert_to_miles to convert distance from kilometers to miles with the following formula.

  Implement the index tracking portfolio

Implement the index tracking portfolio by simply regressing the dense index and Design a gradient descent method for solving it.

  Design and implement a data structure for a social network

In this assignment you are required to design and implement a data structure for a social network (e.g., Facebook, LinkedIn, etc). You would also be required to implement an algorithm to show the connection.;

  Write a python program to display your height

Write a Python program to display your height in centimetres and in feet. To convert from centimetres to feet: 1 cm = (1/30.48) ft

  Defining the right incentives for your agents will be key

Defining the right incentives for your agents will be key. The seller makes money by selling and hedging the option - Start with 2 agents: one option seller.

  Why modules would benefit an application you are designing

What is operator precedence? How can a debugger help you an Find operator precendance error? Define in order the steps/phases of SDLC.

  Write several functions to perform operations on the queue

You will use a list to implement a queue and write several functions to perform operations on the queue. A queue is a data structure use to store items.

  ?write program that uses main and a void function

?Write program that uses main and a void function named randnums that takes no arguments and does not return anything.

  COSC2670 Practical Data Science with Python Assignment

COSC2670/2738 Practical Data Science with Python Assignment Help and Solution - RMIT University, Australia. Task 1 - Data Preparation

  Make a python program that uses the getcwd

Make a Python program that uses the getcwd() function to provide a string of the current working directory. Save the string in the variable current folder and display the value.

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