




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





CodeLab (conditionals, loops) due at midnight Exam 1 tomorrow during class No labs this week Proj 3 due next Friday Topics: Basic Java program Variables and operations Printing, user input (including conversions) Conditional statements (if, if/else, if/else if, switch) Loops (while, do-while, for, nested loops) Types of problems: Full Java programs “Code fragments” Reading code – what is printed What is wrong CIS 200 Exam 1 (50 points) Tuesday, September 15, 2009 Name: ______________________________________ This test is closed-books and closed-notes. Please do your own work.
false d) int sum = 0; for (int i = 1; i <= num2; i += 2) { switch (i) { case 1: System.out.println(“first”); case 2: System.out.println(“second”); case 4: System.out.println(“fourth”); case 8: System.out.println(“eighth”); default: System.out.println(“other”); } sum += i; } System.out.println(“Sum is “ + sum); (num2 = 11) sum = 1, 4, 9, 16, 25, 36 I = 1, 3, 5, 7, 9, 11, 13 Prints: first second fourth eighth other other other other