CS 1063  Week 5:  Exam 1 Review  

Objectives

Assignments


Material to Review

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.

Answers to the self-check problems can be found at Building Java Programs 3rd Edition, Self-Check Solutions.

Terminology

algorithm
cast
compiler
concatenation
constant
data type
declaration    
expression    
flow of control    
identifier
iterative enhancement    
Java
keyword
loop
method
method call
precedence
procedural decomposition
program
pseudocode
scope
statement
string
variable

Notation

" "
%
' '
( )      
*
*=
+
++
+=       
-
--
-=
/
/* */    
//
/=        
;
<
<=
=
\"
\\
\n
\t
{ }
 
 
 

Keywords

boolean         
char
double
for
int
main
nextDouble      
nextInt
public class
public static final
public static void
Scanner
System.out.print
System.out.println

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.]
+----------+
|          |
+----------+
|   Java   |
+----------+
|          |
+----------+
|   Java   |
+----------+
|          |
+----------+
Write a program that computes the following variable y from the variable x.
y = 12.3x4 - 9.1x3 + 19.3x2 - 4.6x + 34.2
[See Self-Check Problem 16 in Chapter 2.]
Write a for loop that produces the following output one number at a time:
-4 14 32 50 68 86
[See Self-Check Problem 20 in Chapter 2.]
Write a nested for loop that produces the multiplication table:
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
[Compare to Self-Check Problem 26 in Chapter 2.]

After you are able to produce the above output, add tabs so that the columns look better.

Write a Java program that inputs an int from the user and prints that number multiplied by 2.  [See Self-Check Problem 24 in Chapter 3.]