CPSC 112 Midterm: CS 112 Yale 12Fall a Midterm Solution
Document Summary
Cis 110-001 fall 2012 midterm, 7 june 2012, answer key: (1 points) Miscellaneous (a) write your name, recitation number, and pennkey (username) on the front of the exam. (b) sign the certi cation that you comply with the penn academic integrity code. Money, money, money, money, money : (4 points) Different public static double iterativeinterest(double balance, int months, double rate) { for (int i = months; i >= 0; i--) balance = balance * rate; return balance; We will consider your answer correct as long as it shows you understand what the program will print out: % java fever java. lang. arithmeticexception: / by zero: % java fever 1. 3 2. 5 7. 1 java. lang. numberformatexception: for input string: "1. 3, % java fever 1 2 5. 2: % java fever hello world java. lang. numberformatexception: for input string: "1. 3" Identify eight errors in the following program that prevent it from compiling or from running and show how to correct them.