Determining the square root of a number

Assignment Help Basic Computer Science
Reference no: EM132206107

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: EM132206107

Questions Cloud

Does the service price influence your thinking : ow do you determine quality in services? For example, how do you distinguish a good lawyer from a bad one? Does the service's price influence your thinking?
Support for successful continuous improvement program : Explain in your own words the importance of management support for a successful continuous improvement program.
About the future of currency and methods of payment : What are your thoughts about the future of currency and methods of payment - where do you see things going? Might we be without currency one day in near future?
Was it a good decision to expand the business to cairo : Was it a good decision to expand the business to Cairo? What are the implications of information systems?
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.
Human-computer interaction : In human-computer interaction, what are some approaches that are useful in understanding the design of information systems at the interface level?
Associated with the programming language names : Briefly explain the "meanings" associated with the programming language names C++, Lisp, Prolog.
Two fundamental data types : Lists are also supported in Prolog. In C and C++, a list can be implemented using what language supported data structure?
Think for a moment about the telecommunication industry : Think for a moment about the telecommunication industry today and what it was just a few years ago, where are we headed?

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