For Java programming, review your labs, your Project 1, and the
activities from the lecture notes. Some of these will likely be
part of the exam.
For general knowledge, review Chapters 1-2 and pp. 166-169, 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
6, 9, 12, 14, 16, 18-19, 22-25
Chapter 2
Everything
1-2, 6-7, 11-12, 16, 19-20, 23, 26-27, 32
pp. 166-169 in Chapter 3
Last Paragraph
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.
combining two or more strings into a larger string
constant
a named value that cannot be changed
data type
a name for a category of values
declaration
specifies a variable with a name and type
expression
a value or a combination of operations that produce a value
flow of control
the order in which statements are executed
identifier
a name for a class, method, or variable
iterative enhancement
writing a program in stages
Java
a programming language
keyword
a word reserved for a particular use
loop
executes a group of statements repeatedly depending on a test
method
a group of statements with a name
method call
a command to execute the statements in a method
precedence
the order in which operators are evaluated in an expression
procedural decomposition
separation of a task into subtasks
program
a list of instructions for a computer
pseudocode
English-like description of an algorithm
scope
the part of a program where a variable exists
statement
a single command that can be executed
string
a sequence of characters
variable
a named location for storing a value
Notation
Hover mouse for more information
" "
%
' '
( )
*
*=
+
++
+=
-
--
-=
/
/* */
//
/=
;
<
<=
=
\"
\\
\n
\t
{ }
This is notation long
" "
contains a string
%
remainder (or mod) operator
' '
contains a char
( )
used in method headers and method calls
*
multiply operator
*=
multiply a variable times an expression
+
addition operator
++
increment a variable
+=
add an expression to a variable
-
subtraction operator
--
decrement a variable
-=
subtract an expression from a variable
/
division operator
/* */
contains a comment
//
starts a comment
/=
divide a variable by an expression
;
ends a statement
<
less than
<=
less than or equal to
=
assignment operator
\"
escape sequence for "
\\
escape sequence for \
\n
escape sequence for a newline
\t
escape sequence for a tab
{ }
encloses a class or a group of statements
Keywords
Hover mouse for more information
boolean
char
double
for
int
main
nextDouble
nextInt
public class
public static final
public static void
Scanner
System.out.print
System.out.println
boolean
primitive type for true and false
char
primitive type for characters
double
primitive type for real numbers
for
a loop typically used to count from one number to another
int
a primitive type for integers
main
the method that starts a Java program
nextDouble
Scanner method for reading a double
nextInt
Scanner method for reading an int
public class
used to begin a class
public static final
used for declaring class constants
public static void
used to begin a method
Scanner
used for reading input from the keyboard
System.out.print
prints output without a newline
System.out.println
prints output followed by a newline
Exam 1 B
Additional Activities
Write a Java program that generates the following output.
Use static methods to show structure and eliminate redundancy
in your program.
[For something similar, see the DrawBoxes,
DrawBoxes2, and DrawBoxes3 programs on pp. 31-36.]