Question: 1 . a . Write a function ( f i b 1 ( ) ) using iteration, that takes an int (
a Write a function f i b using iteration, that takes an int boldsymbolm a x as input, and calculates and prints all the Fibonacci numbers below max. The function also returns a value indicating how many numbers in the Fibonacci sequence have a value less than max.
b Write a function fib using recursion, that takes an int boldsymboln as input, and calculates the boldsymbolntext th Fibonacci number.
c Randomly generate an int boldsymbolm a x between and Call fiblmax and print the value returned by f i b with a suitable message.
d Ask the user to input a number boldsymboln between and You can assume the user will enter a valid input in the proper range. Use the function fib to generate and print the first boldsymboln numbers in the Fibonacci sequence.
Sample outputs for parts c and d respectively:
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
