Determining the square root of a number via recursion

Assignment Help Business Management
Reference no: EM132213843

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

Questions Cloud

Exclusive choice between options : Typically grouped together and implies to the user a mutually exclusive choice between options
Write a shell script that reads a directory name : Write a shell script that reads a directory name and displays all the Cpp files in this directory.
Physical address translation of the logical address : Write the physical address translation of the logical address 0001010010111010 under the following hypothetical memory management scheme:
Write a simple program that schedules classes : Write a simple program that schedules classes into available classrooms in C++.
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.
Display a palindrome forward then backward : Write a very simple program that uses two for loops and ONLY pointers and pointer arithmetic.
In which program do you feel you are strongest : In which program do you feel you are strongest? What do you think you could do to bolster your strength in the other programs?
Compute the probability that in a group of n people : Write simulation program to compute the probability that in a group of N people, at least two share a common birthday.
What are the corresponding file name : What are common Windows utilities used to maintain Windows? What are the corresponding file name?

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

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