Quiz 4
Friday
With a piece of paper, write down your name and answers to the following questions.
Consider the following program?
public final class Program {
public static void main(final String[] args) {
mysteriousTwo(3);
}
private static void mysteriousTwo(final int n) {
if (n < 1)
return;
mysteriousTwo(n - 1);
mysteriousOne(3);
}
private static void mysteriousOne(final int n) {
if (n <= 1) {
System.out.println("Hurrah");
return;
}
System.out.println("Hip");
mysteriousOne(n - 1);
}
}What is the base case for the
mysteriousOnemethod?Answer:
n <= 1.What is the recursive case for the
mysteriousOnemethod?Answer:
n > 1.What is the output of this program?
Answer:
Hip
Hip
Hurrah
Hip
Hip
Hurrah
Hip
Hip
Hurrah
Student Performance and Statistics
A histogram of student performance on percentage grades for Quiz 4 on Friday.
A table showing the average performance for each question in Quiz 4 on Friday.