Determining the square root of a number

Assignment Help Basic Computer Science
Reference no: EM132211148

Determining the Square Root of a Number Via Recursion For this programming project you will develop an recursive function to ?nd the square root of a number. The function should the number for which we are determining the square root and any other arguments you deem necessary. The recursion should terminate when the calculated square root produces a squared value within 0.001 of the value we are ?nding the square root of.

The following is required:

1. The user should be prompted to input a positive number.

2. The program should check to determine whether the user entered a valid number, i.e. -4.0 doesn't work.

3. The program should call a function called: recursive sqrt(argument, argument, ....).

4. The recursive square root function should continue to call itself until the value calculated for the square root when squared is within 0.001 of the value for which we are calculating the square root.

5. Your calculated value of the square root should be printed to the screen.

6. The program should then use math.sqrt to calculate the value of the square root and display this as well.

7. How did your calculated square root compare to the value calculated with math.sqrt.

8. Submit your program within a ?le named: sqrt.txt.

Reference no: EM132211148

Questions Cloud

Display the frequency table of the characters in the file : Write a program that prompts the user to enter a file name, displays the frequency table of the characters in the file.
A program to prompts the user to enter the number of book : Write a program that prompts the user to enter the number of books that they are purchasing.
Write a program that prompts a user to enter a real matrix : Write a program That prompts a user to enter a real matrix A ofsize2x3 and a real matrix Bofsize 2 x 3 The program reads these two matrices.
Write the physical address translation of the logical addres : Write the physical address translation of the logical address 0001010010111010 under the following hypothetical memory management scheme:
Determining the square root of a number : Determining the Square Root of a Number Via Recursion For this programming project you will develop an recursive function to ?nd the square root of a number.
In which program do you feel you are strongest : In which program do you feel you are strongest? What do you think you could do to bolster your strength in the other programs?
Create an array with the number of rows and columns : Write a program which prompts the user to enter the number of rows and columns in a table.
How does remote access permission works : How does remote access permission works? What could interfere with the ability to access a user's system?
Write a program in python to convert a u.s. customary system : Write a program in PYTHON to convert a U.S. Customary System length in miles, yards, feet, and inches to Metric system length in kilometers, meters.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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