
CS121/IS232
Review for Final
1. Expressions – One expression with a division, remainder (modulus) and a cast.
14 / 5 = 2 while 14 % 5 = 4
int (2.8) = 2
double (14 / 5) = 2.0
2. for loops – what do they print. See the second midterm
3. If – else statement
if (condition)
Statement;
else
Statement;
The Statement may also be an if-else statement. You can put them together in many different
ways.
Compound statements use && (and), || (or), and ! (not).
if (birthmonth == month && birthday > day) age = age – 1;
4. Short answers on the most recent lectures
5. Array questions
Read a for loop and fill in an array
Modify the array using another for loop
Write a for loop and a while loop that do something with the array
6. More array questions – ones like those on arrays of Strings in worksheet 7.
7. Fill in the code for three methods similar to the ones you did for the first Attendance
class, the one with a single array of integers, and not the one that computed the gate.
8. Multiple choice and fill in the blanks questions from the department. These are
cumulative.