Question
In python language, write a program that defines three recursive functions. - divRecur(a, b): calculate and return the integer division of a and b, where
In python language, write a program that defines three recursive functions.
- divRecur(a, b): calculate and return the integer division of a and b, where a and b are positive integers.
- modRecur(a, b): calculate and return a mod b, where a and b are positive integers.
- is5sPower(n): test if n is a power of 5, if n is a 5s power, the function returns True, otherwise, returns False.
Your program should meet the following requirements:
- Operators /, // and % cannot be used in the divRecur() and modRecur(). - All the functions should be recursive. The recursive function can only call itself in the function body, No other functions can be called. A user-friendly menu should be provided so that the user can repeatedly run the program.
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