previous
 next 
CS 1063  Week 10:  Exam 2 Review
Spring 2015: Section 1

Objectives

Assignments

Exam Info


Material to Review

You will be given a sheet of standard methods you can refer to during the exam.
You can see a copy of this sheet here.

Although you need to understand the concepts related to the DrawingPanel, there will not be any questions on the exam asking you to write or understand code involving the DrawingPanel or the Graphics objects.

For Java programming, review your labs, your Projects 1 and 2, and the activities from the lecture notes.  Some of these will likely be part of the exam.
For general knowledge, review Chapters 1-4, Supplement 3G, your quizzes, and the lecture notes.  Understanding the chapter summaries and self-check problems is a good way to start reviewing the book material.  Below is a table of particular items to pay attention to:

  Reading     Chapter Summary     Self-Check Problems  
Chapter 1 Everything 3rd(6, 9, 12, 14, 16, 18-19, 22-25); 2nd(6, 8, 11, 13, 15-17, 19-21)
Chapter 2 Everything 3rd(1-2, 6-7, 11-12, 16, 19-20, 23, 26-27, 32); 2nd(1-2, 6-7, 11-12, 14-15, 21, 27)
Chapter 3 Everything 3rd(5-6, 10, 13-14, 16, 20-21, 24, 26); 2nd(2-3, 7, 10-12, 14-15, 18-19)
Supplement 3G     Everything 3rd(3-4); 2nd(2-3)
Chapter 4 Everything except System.out.printf 3rd(1-2, 5-7, 9, 16, 20, 26-27); 2nd(1-5, 7, 13, 17, 23-24)

Note: All the Self-Check Problems are good to do. The above selects a subset of them as examples of what to study.
The terminology, notation, and keywords below are in addition to the lists in the Exam 1 Review.

Terminology

Hover mouse for more information
branch object
class parameter
control structure precondition
counter postcondition
cumulative algorithm       return type
exception roundoff error
index test


Notation

Hover mouse for more information
  ==     !=  
  <     <=  
  >     >=  
  &&     ||  


Keywords

Hover mouse for more information
else Character
equals        DrawingPanel
if Graphics
new Math
return Scanner
void String

Additional Activities

Exam 2 Activities 1
Write a method that has three integer parameters and returns the minimum value.  Write one version using Math.min.  [See Self-Check Problem 12 in Chapter 3.]  Write another version using a nested if statement.

Exam 2 Activities 2
Write a method that has three integer parameters and returns the median (middle) value. [See Self-Check Problem 24 in Chapter 4.]

Exam 2 Activities 3
Write a method that has two parameters, a Scanner and a String, and returns an int.  The method should use the String to prompt the user and use the Scanner to input the value.  That is, we want to replace this code:
System.out.print("Enter your most favorite integer: ");
int mostFavorite = console.nextInt();
System.out.print("Enter your least favorite integer: ");
int leastFavorite = console.nextInt();
with:
int mostFavorite = getInt(console, "Enter your most favorite integer: ");
int leastFavorite = getInt(console, "Enter your least favorite integer: ");
Write two other methods, one for inputting a double and the other for inputting a String.  Write a Java program for testing your methods.

Exam 2 Activities 4
Create modified versions of the countLetters method on pp. 256-257 to perform the following tasks. Write a Java program that inputs lines from the user and prints the results of these methods for each line.

Exam 2 Activities 5
Write a Java program to input 10 doubles from the user and print the minimum.  Hint: Modify the MaxInput program in the lecture notes.

Now modify your program so it also prints the maximum and the average.

Exam 2 Activities


Exam 2 Review