What to review for the final
-
The final will be Wednesday 12/12, 10:30 AM - 12:30 PM in LIB 100.
- The final exam is cumulative; the last topic covered is arrays of primitive types (e.g. array of integers). For the most recent topics of arrays and loops, review the codelab exercises and practice problems on loops and arrays.
No graphics, no javafx, no switch statement.
-
Review the underlying topics of whatever
questions you answered incorrectly on the tests (midterm and quizzes).
Since the course material is by nature cumulative,
you may find that when reviewing relatively recent material
(such as arrays, loops, methods), you may need to review earlier material
(such as working with variables vs. literals, and conditional statements, e.g. if, if..else, nested if).
- Especially for those topics you had difficulty with,
review your notes/exercises from class/website, codelab/lab/homework.
- Format: Short answer questions, plus one long programming problem.
Question types, as on previous tests and practice problems on loops and arrays:
Short answer questions:
- What is the output produced by the following Java code?
- Write a method, loop, statement or expression that does what is specified.
Long answer question:
There will be a question in which you are asked to write a complete class, along the lines of lab exercises and the quiz 2 programming problem (solution posted on examples link): write a class named _____ with instance data (attributes / state variables) to represent ___,
a constructor to initialize the instance data, methods that _____, and driver code
(a static test method in the same class, or a main method in a separate class)
to create objects and call the methods appropriately on those objects.
Corresponding material in the book/slides
- Chapter 1: Introduction
- Chapter 2: Data and Expressions
- Chapter 3: Using Classes and Objects
- Sections 1 through 5. Given the documentation that the Java Standard Library provides for using a predefined method of a predefined class (e.g. String, Math), write code that uses that method, as you did for Quiz 2 and in lab when you used predefined classes such as Math, String and Random.
- Chapter 4: Writing Classes
- Sections 1 through 5. Given a description of a Blueprint class (with attributes (aka instance variables aka state-variables), constructor, and at least one method that computes something) and Driver code to test it, implement/define these.
- Chapter 5-6: Conditionals and Loops
- The if Statement and Conditions (boolean expressions)
- Other Conditional Statements: if-else, nested/cascaded if
- Comparing Data
- Compare integers/characters using ==
- Compare floating point numbers: If the difference between the two floating point values is less than the tolerance, they are considered to be equal.
- Compare objects using equals method.
- The while Statement
- Other Repetition Statements: for loop and do-loop
- Chapter 7: OO Design and Method Decomposition
- This is what you are doing for homeworks 5 and 6. I will post a sample solution to homework 5 (design) on Wednesday December 5. The best way to prepare for an exam like this is to practice programming; try to complete your codelabs and assignments (hw 6); try to solve problems that you have solutions for (e.g. those on the examples link) without looking at solution...
- Parameter passing: passing primitive values vs. passing objects (review problem 8 of practice problems on loops and arrays, and lab exercise 38a: ParameterTester program).
- Chapter 8: Arrays
- Declaring and using arrays (arrays of primitive types; no arrays of objects, no two-dimensional arrays)
- Passing an array as a parameter to a method (as in the recent practice problems and ArrayPassingDemo.java); arrays are treated as objects, and therefore are passed by reference.