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

  Master test plan and test plan

What is difference between Master Test Plan and Test Plan.

  Executing a shell script

Use vim (Lab Manual, page 34) to create a file named short with the follow¬ing line in it: echo 'hi there'

  Positive integer number from user and outputs

Write a program that takes a positive integer number from user and outputs the number in the range from 1 to whatever user has entered with maximum sum of its divisors. The maximum sum of divisors should be outputted as well.

  Factoring polynomials when the leading coefficient

What process do you use to factor polynomials when the leading coefficient is not 1 (example: ax2 + bx + c)? How does this differ from factoring polynomials when the leading coefficient is 1 (example: x2 + bx + c)? Is it possible to solve every qu..

  Calculate waccs based on book

The tax rate is 40%. Calculate WACCs based on book, market, and target capital structures.

  Why would this implementation be better than original one

If there were more passes than fails, why would this implementation be better than the original one?

  Displays a rectangular box that is a solid color

Create an application that displays a rectangular box that is a solid color. The box should not be larger than 200x40 and should be centered. Provide the following features:

  Provide a plan that addresses planned organizational change

Question 6.6. (TCO F) Provide a plan that addresses planned organizational change using judicious automation, rationalization of procedures, business process redesign, and constructive paradigm shifts that improve the way business is managed.

  How the technology creates or contributes to the problem

Choose one ethical issue arising from the use of ICT that has been reported in the press in the last one year, and discuss it in depth. Show why or how the technology creates or contributes to the problem.

  Describe findings after conducting internet search for cde

The network administrator mentions that other ".cde" files have been sent through an FTP server to another site. Describe your findings after conducting an Internet search for ".cde" files.

  Determine the size n of the dft

For this problem, interpret the N-point DFT as an N-periodic function of k. Answer yes or no if the following frequencydomain signals are valid DFTs. For each valid DFT, determine the size N of the DFT and whether the time-domain signal is real.

  What is the candidate key of this relation

Each owner can own more than one vehicle. The other attributes are not unique. What is/are the candidate key(s) of this relation? If there is more than one candidate key, choose one as the primary key and indicate which is/are the alternate key(s)..

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