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 to solve a couple of given problems. (You should be prepared to give a complete program, including full class heading and main method.) Midterm #1 Topics ----------------- Disclaimer: Everything that has been covered in lecture, in discussion, or on homeworks 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.) Computers --------- - Hardware, Software, CPU - Source code, compiler, byte code - Different kinds of memory 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) - Loops (while and do-while) - Strings and String operators Classes, Objects and References ------------------------------- - Classes and objects - Object instantiation (new and constructors) - Reference variables - Objects with no references - Methods (how to call them but not how to define them). You must know how to define main(). Java Packages ------------- - Output using System.out.println() - Input and output using JOptionPane (showMessageDialog, showInputDialog, showConfirmDialog) - The import statement - The Math class - The NumberFormat class - Using parseInt, parseDouble, and parseFloat to produce numeric values from strings. Program Development ------------------- - Software development life-cycle - Break down a problem into a solution using pseudocode Reading in Lewis and Loftus --------------------------- You are not responsible for material from Lewis and Loftus that has not been discussed in lecture, but it is a good idea to review this material and the exercises in the back of each chapter, since this will provide you with a more complete understanding of the material. Chapt 1 (skip 1.5) Chapt 2 (skip 2.10 and 2.11 and the classes Random, Keyboard, and DecimalFormat) Chapt 3 (skip 3.3, 3.8, and 3.10 and StringTokenizer) Sections 4.0-4.2 (basic class concepts, skip UML diagrams) Sections 5.0-5.1 (references) and 5.6 (JOptionPane) 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, and the cmsc131PictureLib, since you will be asked to use them to write programs. Although we will not be picky about spelling, we will expect you to know how to apply these commands to solve programming problems. - 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. (If you forget there is a clock in the back of the room.) Work quickly but carefully, keep an eye on the time, and do not devote too much time to any one problem. - If you cannot remember a Java command for a certain function, you can get partial credit by expressing your intention in pseudo-code. In particular, do not get stuck because you forgot some syntax. Express your intentions (in English if necessary) and move along to finish the rest of the problem.