Question: ITP - 1 5 0 - Assignment - Recursion - Instructions Requirements: Write a Python program that has three functions that do the following: 1
ITP Assignment Recursion Instructions
Requirements: Write a Python program that has three functions that do the following:
Function: main
No parameters.
Return: None
Processing: Print welcome message. Call askforint to get an int that the user has entered use low of and high of Call factorial, passing in the integer that the user entered. Ask the user if they would like to loop again. If so loop again, if not, then quit the loop. Print goodbye message.
Function: askforint Parameters: low, high Return: int the user entered
Processing: Ask the user to enter an integer. Using exception handling, check to see if user entered a valid int. If not int, print error message and loop again. If valid int, also check to see if within low high range. If not in range, print error message and loop again. Return valid integer the user entered.
Function name: factorial Parameters: num Return: the factorial answer
Processing: Compute the factorial using recursion. Do not use a loop within this function. Must use recursion. Watch the videos provided to get some clues on how to write this function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
