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

  Components and purposes of information technology

"Compare and contrast components and purposes of Information Technology (IT) and Information Systems (IS) in organizations"

  Professional development opportunities

Identify a professional organization that would provide professional development opportunities for the role you selected. Describe professional development and other opportunities the professional organization would provide to you as a member.

  Difference in real gdp per capita between country

Suppose that yA(0) = yB(0) = 1, gA = 2% and gB = 4%. What is the (log) difference in real GDP per capita between country A and B when t = 50?

  How many tickets would the team sell if it behaved

i) How many tickets would the team sell if it behaved competitively? And what is the price of the ticket?

  Write a program to sort students'' gpa in descending order

write a program to sort students' GPA in descending order.

  Standard normal curve

1. Find the area under the standard normal curve of each of the specified intervals. a) to the left of z=0.42, b) to the right of z=-1.82, c) Between z= -2.48 and z=1.94 d)to the left of z = -2.62 or to the right of z=1.93

  Write essay which compares conventional validation methods

COS6020 - Software Verification - what is model checking and how it works - Using the CTL model checking algorithm prove that the CTL formula in b) is verified

  Producer surplus after a rent control is established

(a) What happens to consumer and producer surplus after a rent control is established? Do they increase or decrease? Explain.

  Determine the maximum period obtainable from lcg

Determine the maximum period obtainable from following LCG? Xn+1 = aXn (mod 24). What must be the value of a?

  Importance on disaster recovery

Explain why some organizations may not place enough importance on disaster recovery.

  Is it possible for an instruction to be receiving forwarding

Is it possible for an instruction to be receiving forwarding information and simultaneously being flushed?If possible, can you provide an example sequence of instructions?

  How they can be represented in an er schema diagram

how they can be represented in an ER schema diagram.

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