Question
Determining the Square Root of a Number Via Recursion For this programming project you will develop an recursive equation which takes a number as an
Determining the Square Root of a Number Via Recursion For this programming project you will develop an recursive equation which takes a number as an argument and calculates its square root so that when the value of the square root is squared the result is within 0.001 of the value we are finding 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 doesnt work. 3. The program should call a function called: recursive sqrt(argument, argument) or recursive sqrt(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. The program should then use math.sqrt to calculate the value of the square root 6. The program should print out both the square root determined via the recursive function as well as the square root determined by the math library
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started