Question
A) Write a recursive function that reads a list of integer values, sentinel -1, and prints all multiples of 3. The signature of the function
A)
Write a recursive function that reads a list of integer values, sentinel -1, and prints all multiples of 3. The signature of the function is:
void multipleThree(Scanner in){ }
B)
Write a recursive function that takes an integer array as one of its arguments and computes the frequency of the number 0 in the array.
C)
Write a recursive function that prints a given positive integer value as its binary equivalent. For example, if the value is 11 the output should be 1011.
D)
The recursive function fibSequence() described in the book and in the lectures generates and prints the first n terms in the fibonacci sequence. Re-write this function so that it actually stores the terms in an array of size n, where n is the number of terms required, as it generates them. The signature of this function is:
void fibSequence(int i,int n, int f[]){ }
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