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

  Building presentations in microsoft powerpoint

What is the most important do's and don'ts when building presentations in Microsoft PowerPoint?

  Relating counter measure strategies

This assignment involves completing two exercises, and the purpose is for you to apply the safety and health management systems approach to workplace ergonomics

  Preference minorities such as homosexuals

Can employers protect the rights of people whose religion teaches them that homosexuality is immoral and those people who are sexual preference minorities such as homosexuals. How so? Support your reasoning with specific examples and please use ..

  Purpose-duties and investigative processes of the ntsb

Explain the purpose, duties and investigative processes of the NTSB including the Party Process and clarify the statement that the NTSB is an independent agency

  Secure electronic transactions

There are five elements of network security that help your company and its customers engage in secure electronic transactions. Name each of the five elements of network security, provide a brief description of each and suggest One appropriate solu..

  Aware of when participating in the project

What legislation might you need to be aware of when participating in the project?

  What is the form of stabilization policy

What is the form of stabilization policy that has received the most attention over the past 30 years?

  Growth in the hospitality industry

1) Describe how career opportunities have changed over the years due to growth in the hospitality industry.2)  Describe how the hotel market has been affected by changes in consumer expectations.

  Specific listing for an analysis for cinemark

How do you a specific listing for an analysis for Cinemark?

  What monthly payment will the taylors

Interest computations are made at the end of each month. If the loan is to be amortized over 30 years, what monthly payment will the Taylors.

  Evaluate the completeness of strategy for future growth

Suppose Honest Tea has hired you as a consultant to evaluate the completeness of their strategy for future growth.

  Voluntary and involuntary turnover

Describe voluntary and involuntary turnover, and compare and contrast the effects that each type of turnover has on an organization.

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