Determining the square root of a number via recursion

Assignment Help Business Management
Reference no: EM132200713

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

Questions Cloud

Find new annual profit from a hectare of land : Suppose that the development of synthetic indigo decreases the price of indigo to $5. The new annual profit from a hectare of land is $ ____________.
Why does college cost so much : From the end of World War II through the 1970s, the supply of higher education increased massively as state and local governments spent billions of dollars.
Describe the classic marx approach : What are the differences between the classic Marx approach to capitalist globalization and the "world systems theory"? The response must be typed.
Frame number happens to be four times smaller : A paging system with a 256address page size, using a page table in which the frame number happens to be four times smaller than the page number.
Determining the square root of a number via recursion : 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.
What is the income velocity of money : If the production increases by g% and nominal interest is still, at what % would the real money balance increase? What is the income velocity of money?
How well did the media cover the midterm elections : PSCI 1121: Which specific outcomes/ races seemed to be the most important/ significant? How do those specific races impact the overall outcome of the mid-term?
What is the reason causing the saving rate at such level : Do you think the saving rate in US is above or below the sgold? What is the reason causing the saving rate at such level?
Determine the slope and shape of the curves : Graph the individual marginal benefit and marginal social benefit curves of a Teibout community (you can determine the slope and shape of the curves).

Reviews

Write a Review

Business Management Questions & Answers

  Assignment-physician reimbursement

Directions: With the increasing cost of health care, MCOs have been under tremendous pressure to control health care costs, including physician reimbursement. In this assignment, you are to look at some of the issues that are involved in physicia..

  Compare with the original equilibrium in part

If there is an increase in autonomous import expenditure from100 to 200 resulting from an increase in the currency exchangerate, calculate the new equilibrium level of income and the valueof the multiplier. Compare with the original equilibrium i..

  Current job market for the industry of interest

Research and report on the current job market for the industry of your interest. Your report should focus on a particular U.S. locale (i.e. southwest Alabama, the state of Alabama, the southern region of the U.S., etc.).

  Fair market value of a share of dvorak

If the required rate of return on this stock is 12 percent, what is the fair market value of a share of Dvorak?

  List the types of controversies over which federal courts ha

List the types of controversies over which federal courts have subject matter jurisdiction. Then find an article giving an example of a federal legal dispute.

  When setting up your distribution channel

When setting up your distribution channel, do you feel intensive, exclusive or selective distribution would be best. Why?

  The design and layout of a new facility

An important OM decision that is not made often is the design and layout of a new facility. The main OM goal is to assure that the layout and design support the organization's operations in the most efficient and effective manner

  Examine the issues surrounding this decision

examine the issues surrounding this decision. Comprise an overview of the law and explain why or explain how it came about. If the law relates to an actual court case, comprise a short summary of the actual case.

  Explain management often disagrees with the use of seniority

Explain Management often disagrees with the use of seniority to determine promotion decision

  Today competitive marketplace

Describe some of the 'best practices' that could be adopted by a company to enable its employees to assist the company in its quest to thrive in today

  Strategies have improved experience

Use service-dominant logic (SDL) to describe a situation in which you engaged in co-creation of value. What strategies could the marketer have used to enhance this experience for you? How would these strategies have improved your experience?

  Capital budegeting cash flows

The present value of the cash flows dictates the manager's decision. Are cash flows that are estimated in lease analysis more or less risky than capital budegeting cash flows?

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