Your quiz will be quite similar to this one. It will, however, be more different than the previous ones: it won't just be names and types changed. We'll ask you to come up with simple algorithms to show you understood the basics. But if you have little trouble with this quiz, the A3 quiz won't be a problem. Student number: ________________ Last Name: ________________ First Name: ________________ [Here, we'll give you the API summary for all relevant classes.] ---------------- 1. Complete the method below. /** * Prompt the user for two floating-point numbers (with a separate input * dialog window each) and display their sum (in a message dialog). */ public static void interactiveSum() { } Answer: JOptionPane.showMessageDialog( null, Double.parseDouble(JOptionPane.showInputDialog("Enter number")) + Double.parseDouble(JOptionPane.showInputDialog("Enter number")) + ""); ---------------- 2. Complete the return statement for the method below. /** * Return a BufferedReader for the file named f. */ public static BufferedReader createBR(String f) throws Exception { return } Answer: new BufferedReader(new FileReader(f)); ---------------- 3. Complete the following method so that it reads a sequence of floating-point numbers from the file specified and returns their sum. You may use method createBR from the previous question and assume it resides in the same class as sumNumsInFile. public static double sumNumsInFile(String f) throws Exception { } Answer: BufferedReader br= createBR(f); double sum= 0; String s= br.readLine(); while (s != null) { sum += Double.parseDouble(s); s= br.readLine(); } return sum; ---------------- 4. Write a complete JavaDoc comment for method sumNumsInFile above. Answer: /** * Return the sum of the floating-point numbers in the file named f. */ ---------------- 5. Complete the method below. /** * Print the numbers n, n - 1, n - 2 ... 7, one per line. * Precondition: n >= 7. */ public static void printDownTo7(int n) { } Answer: while (n != 6) { System.out.println(n); --n; } ---------------- 6. /** * Print the characters in s, one per line. * Precondition: s != null. */ public static void print(String s) { } Answer: for (int i= 0; i != s.length; i++) { System.out.println(s.charAt(i)); } ------------------------------------------------------------------------