Exam Structure -------------- a. The exam will take 50 minutes exam and will be held in discussion session (not in lecture). Lecture will still take place on Monday. b. The exam will be closed book/closed notebooks. No calculators are allowed. (We recommend using a pencil and eraser, rather than a pen.) c. Format: i. Short answer questions. (This includes for example, multiple choice, True/False and fill-in-the-blank type questions.) ii. Code analysis questions. (We will give a short segment of code and you may be asked to identify syntax and logical errors, or to generate code output) iii. Write a program/code snippets to solve a few given problems. (You should be prepared to give a complete program, including full class heading and main method, but we may also ask you to provide just a single method or a fragment.) Midterm #1 Topics ----------------- Disclaimer: Everything that has been covered in lecture, in discussion, or on the homework (project) is fair play. The following is a list of topics to help in studying. (We have tried to be complete, but we might have forgotten a few topics. If you don't see your favorite topic here, please check with us, since it may just be an oversight.) Java ---- - Statements, expressions - Local variables - Primitive type variables - Code blocks ({}) - Identifier naming conventions - Constants, literals - Variable scope, duration - Assignment (=) - Operators (new, +, -, *, /, %, ==, !=, <, <=, >, >=, &&, ||, !, etc.) - Increment/decrement (++, --) - Short-circuiting with && and || - Assignment operators (+=, -=, /=, ...) - Operator precedence and associativity (left-to-right or right-to-left) - Conditionals (if, else) - Strings and String operators - Pass by value - Return values - Strings (including conversion to/from primitive types) - Variables (instance, parameter, local, shadowing) - Loops (while, for, do-while), nested loops - switch statement - break and continue statements - One-dimensional arrays (of primitives and of references), passing as parameters and returning arrays from methods Classes, Objects and References ------------------------------- - Classes and objects - Object instantiation (new and constructors) - Reference variables - Objects with no references - Methods (how to call and define them). You must know how to define main(). Java Packages ------------- - Output using System.out.println() - Input and output using JOptionPane (showMessageDialog, showInputDialog) - The import statement - The Math class - Using parseInt, parseDouble, and parseFloat to produce numeric values from strings. General Progamming Issues: -------------------------- - Program Design - Testing - Debugging - Shallow/Deep copying - Privacy leaks - Program documentation - Call stack and Heap Some Tips: ---------- - Since you will be asked to write and spot errors in code, be sure to review command syntax. In particular, take some time to review basic classes and methods such as JOptionPane, System.out.println, - There are many things that Eclipse does automatically for you (e.g. automatic insertion of braces and parentheses). On the exam, be sure to be careful about your program syntax. These may only be small deductions, but you would rather avoid them. - Time management: Bring a watch with you to the exam. Work quickly but carefully, keep an eye on the time, and do not devote too much time to any one problem.