By the time of Exam 2, you should be able to address each outcome in the following topics:

Arithmetic expressions and assignments

  1. Design and write code that implements an arithmetic formula, using methods from the Java Math class.
  2. Explain the order of precedence in which arithmetic operations (+,/,-,*, %) in an expression are evaluated.
  3. Use parentheses to affect the order in which arithmetic expressions are evaluated.
  4. Use the typecast operation (for example: (int) ) to assign a floating-point value to an integer variable.
  5. Explain the consequences of typecasting a floating-point value to an integer (ie: truncation)
  6. Explain integer division (e.g. why 1/3 results in 0, or 5/2 results in 2)
  7. Use the increment (++) and decrement (--) operators.
  8. Use the Scanner class methods such as nextDouble() and nextInt() to convert string input to numeric values.
  9. Use the Double.parseDouble() and Integer.parseInt() methods to convert Strings to numeric values.

Booleans and conditional logic

  1. Explain the boolean datatype and what values a boolean variable may represent.
  2. Design and write boolean conditional expressions using the relational operators (<, <=, >, >=, !=, ==)
  3. Design and write compound conditional expressions using the boolean operators (&& and ||)
  4. Evaluate complex boolean expressions, such as !( ((x>0) && (x<2)) || (y<0) )
  5. Design and write code that uses if, else-if and else statements to alter a program's sequence of execution.
  6. Design and write code that uses the switch statement to alter program flow.
  7. Rewrite an if/else-if/else as a switch statement, and vice versa.
  8. Diagram (e.g., flowchart style) how a if/else-if/else changes program flow.

Looping and iteration

  1. Design and write code that makes use of the while or do-while loop construct.
  2. Use boolean variables and conditional expressions in a while or do-while loop to repeat prompts for user input until valid input is entered.
  3. Design and write code that makes use of the for-loop construct.
  4. Rewrite a given while loop as a for loop, and vice versa.
  5. Diagram (e.g., flowchart style) how a while loop changes program flow, introducing a "loop" in the sequence of statements.
  6. Use break to terminate a loop early
  7. Use continue to repeat a loop early
  8. Write loops that repeat certain operations (summing, evaluating, printing) during each iteration of the loop.
  9. Explain the scope of a variable declared within a loop construct.
  10. Explain the scope of a variable declared within braces.

Using other classes; calling methods

  1. Design and write code that makes use of the methods of classes from tha Java API library (or external libraries), such as JOptionPane, Math and String, based on reading and interpreting available documentation for such methods.
  2. Pass values or variables of the appropriate datatype as arguments to library methods that have parameters.
  3. Use a variable of the correct datatype to receive the return value of library methods that return values.
  4. Explain the concept of the void keyword with respect to a method whose return type is void.
  5. Explain the difference between calling a static method of a class (ie class method) and a non-static (ie instance method) of a class.

Object-oriented programming

  1. Explain what an object is and how it relates to a class.
  2. Explain the difference between an object's attributes (data) and data (variables) that are local to a method, and explain how to distinguish between those pieces of data when both have the same name.
  3. Explain the concept of this.
  4. Explain the concept of static (ie class) attributes vs. non-static (ie instance) attributes.
  5. Explain what is represented by a variable used to refer to an object (e.g. Account a = new Account() - what does a actually contain?)
  6. Explain what happens to an object in memory when a variable used to reference that object is reassigned or set to null.
  7. Explain the concept of a class constructor.
  8. Explain the concept of a default constructor and how & when it is automatically created.

UML and Object-oriented programming

  1. Read and understand UML class diagrams.
  2. Write the method signatures for methods specified in a UML class diagram.