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.