I uploaded a possible solution to the second midterm review question, MidtermReview2.java.
If you're curious, func() in the first question returns the (k+2)th Fibonacci number or -1 when k is not positive, but you don't need to have seen that to work through the loops and get an answer.