Question: Code needed in python! A. Write a function FactRecursion that takes as a parameter a positive integer and returns its factorial using the recursive method.
Code needed in python!
- A. Write a function FactRecursion that takes as a parameter a positive integer and returns its factorial using the recursive method.
B. Write a function FactIterate that takes as a parameter a positive integer and returns its factorial using the iterative method.
C. Write a program that prompts the user to enter a positive integer (and verify it with a loop)
And then calculates its factorial twice, one using FactRecursion, and once using FactIterate. Which function is faster? What happens when we enter a large number?
- (This program uses iteration not recursion)
A. Write a function area that takes as a parameter the radius of a circle and returns the area of the circle. Write another function circumference that takes as a parameter the radius of a circle and returns the circumference of the circle. Use the formulas: Area of circle = x radius2 Circumference = 2 x x radius
B. Write a complete program that produces a table showing the area and circumference of circle for a range of radius values from 1 to 10 with a step of 1. Use the area and circumference functions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
