CPSC 120 -- Final Exam Review Topics
- Operating Systems (Linux overview and lab 0)
- Know what an operating system is
- Know the two main tasks of an operating system.
Know what some of the particular tasks are in the
"managing the hardware resources of the computer" category - what
specifically is the operating system in charge of? (See the Linux/Unix
Overview).
- Understand the file structure of the Unix (Linux) operating system
--- the tree-like organization, the absolute (full) and relative pathnames
for files, shorthand notation for certain files (the dot, tilde, etc.)
- Understand the idea of file permissions -- what they are, what they mean,
how you can find out the permissions in Linux
- Know what a shell is and know the basic Linux shell commands we have used
- Compilers, Interpreters and Languages (Linux overview and lab 0)
- Know the programming language hierarchy
- Know what compilers and interpreters are and what each does (and how
they differ) - know the role of these in our use of Java (when are we
using a compiler and what does it do and when are we using an interpreter
and what does it do)
- Know the difference between the source file and the file containing
bytecode - know the role of each in the compilation process and know
the rules for the names of each type of file (i.e., what must the
source file be named, what is the name of the file created by the
compiler?)
- Know the difference between bytecode and machine code
- General Programming Concepts (Chapter 1 and lab 1)
- Problem solving steps
- General idea of object oriented programming - what is an object,
what is meant by the state of an object, what is meant by the attributes and
behaviors of an object,
what is a class, what are methods?
- Syntax versus semantics
- Comments/Documentation
- Use of White Space
- Levels of programming languages (hierarchy)
- Types of errors in programming (syntax or compile-time, run time, logic)
- Understand the coordinate system for Java graphics
- Basic Programming Constructs (Chapter 2, labs 1 and 2)
- Identifiers -- what one is, syntax rules for identifiers in Java
- Variables - what they are, the difference between what is stored
in a variable of primitive type and one for an object
- Declaration of named constants (final) & the reason for using these
- Primitive Data types in Java
- String and numeric (int, double, char) literals -- syntax
- Data conversion - automatic widening conversions, explicit
narrowing conversions through type casting
- Output - printing using print and println (including + and
escape sequences)
- Input - setting up a Scanner object, prompting the user,
reading input using the
appropriate method (nextInt, nextDouble, nextLine)
- Escape sequences - what they are, how to use, why they are needed
- Assignment Statements - syntax and how one is executed
- Expressions (including the arithmetic operators and the precedence
and associativity rules) - be able to write expressions for computations;
be able to evaluate expressions exactly as the computer would
(including those that contain strings and + as concatentation) and show
the results.
- Print and println statements - be able to determine exactly what
will be printed by a given statement; be able to write statements
to print in the exact format given.
- Objects, Classes, and Methods (Chapter 3 and labs 3 and 4)
- Be able to distinguish between an object and a class
- Be able to declare a variable to be a reference to an
object
- Be able to instantiate an object with the new operator;
understand that this invokes a constructor method for the class
to initialize the object.
- Understand the use of the dot operator to invoke (call)
a method
- Be able to look at the signature of a method and from
that determine how to invoke the method
- Know how one invokes a static (class) method
- Know the basics of using the String class, the Math
class, the Scanner class, and the Random class (be able to write
an expression to generate a random number in a given range).
- In the String class know how to use the following methods:
charAt, length, replace, substring, toLowerCase, toUpperCase
- In the Random class know how to use the following methods:
nextInt, nextDouble
- In the Math class know how to use the following methods: sqrt,
pow.
- Syntax and Semantics
- Be able to find syntax errors in a Java program
- Be able to describe the semantics of statements
we have studied (for example,
what does the computer do with a variable declaration,
what is the relationship between memory and a variable
declaration, how
is an assignment statement executed, how are expressions
evaluated?)
- Be able to trace the execution of a program (show what
it would do in a step by step manner)
- Machine Representation of Integers (Class notes, handout on
twos complement, Lab 5 Prelab and Lab, exercise handouts, Section 2.3
and Appendix B of the text)
- Be able to convert a number in any base to its equivalent base 10
representation.
- Be able to convert a base 10 number to any other base.
- Be able to convert among bases 2 (binary), 8 (octal), and 16
(hexadecimal) without using base 10.
- Be able to find the n-bit (where n is specified) twos complement
representation of a base 10 integer (positive or negative).
- Be able to find the base 10 value of a number represented in twos
complement.
- Be able to find the largest (and smallest) base 10
unsigned number that can be
stored in n-bits; be able to find the largest (and smallest)
base 10 signed twos complement
number that can be stored in n-bits.
- Be able to add base 2 and twos complement numbers; understand the
problem of overflow (what it means and how to recognize it)
and be able to demonstrate it.
- Selection Statements and Boolean Expressions
(Sections 4.1 - 4.4 of the text plus handouts, labs and prelabs)
- Know how to write if ... else ... statements in their various
forms (with no else clause, nested, cascading). Know when you need to
use braces!!!
- Know how to write and evaluate boolean expressions using relational
operators (such as == and <=) and boolean operators (&&, ||, and !);
know that the relational operators such as == work only on primitive data
not on objects (to compare objects you must use methods - equals
or compareTo).
- Know about the boolean data type -- how to declare a boolean
variable and assign the result of a boolean expression to the
variable.
- Know that the switch statement is another selection
statement that can be used when your selection condition is to
test to see if a single variable is equal to one of several different
possible values (the cases in the switch). Understand the role
of the break statement in the switch -- without it once a
condition is true all remaining statements in the switch would be executed
rather than just the one where the condition is true. You will not
have to write a switch statement on the test but you may be asked
some general question or given a switch statement and asked something about
it.
- Be able to trace code with if statements, switch statements, and
boolean expressions to show what it would do (or to determine if it
is correct).
- Logic (Handouts on logic and circuits)
- Know the logic operators AND, OR, and NOT and both the mathematical
and Java symbols for these.
- Be able to construct truth tables for boolean expressions (propositions/
logic statements).
- Know DeMorgan's law of logic - be able to use it both on mathematical
statements and in the context of programming.
- Be able to show two boolean expressions are equivalent using
truth tables.
to find equivalent but simpler statements.
- Understand the connection between logic and computer circuits. In particular,
be able to write a logic statement equivalent to a given circuit, be able
to use the laws of logic to simplify the statement and construct a simpler
but equivalent circuit, be able to constuct a circuit given either a truth
table for its output or a verbal description of the behavior of the circuit.
- While Loops (Section 4.5 & Lab 7)
- Understand how loops work - be able to trace the execution of a loop
showing the value of each variable as the loop executes and/or showing
the output of the loop.
- Be able to write loops. In particular, be able to correctly
do each part that goes into writing a loop:
- write the correct boolean expression for the loop
control condition
- initialize variables before the loop
- update the loop control variable(s) inside the loop
- perform the processing inside the loop (do whatever the loop
is supposed to do!)
- Specifically be able to write loops that do the following
standard looping tasks: count, sum,
find averages, force the user to enter valid input,
find products.
- Know how to recognize and write count-controlled loops
and sentinel controlled loops.
- Testing (Lab 6)
- Be able to determine test cases to test a program (a) when there
are many different paths through a program (such as Rock, Paper, Scissors)
and (b) when a value should be in a specific range (such as the Date program).
- Loops (Sections 4.5 (while - this was on the last test
but you still need to know how to do them!), 4.7 (do...while),
4.8 (for loops),
Labs 7 - 10, class notes, quizzes)
- Know the three basic loop structures and the differences
among them; given a loop of one type (for example, while) be able to
write an equivalent loop of another type.
- Be able to trace a loop to determine what it does - this includes
showing values of variables as it executes, showing what it prints,
or giving a verbal high-level description (such as finds the product
of the multiples of 3 from 1 to n).
- Be able to write loops -- be able to correctly control
the loop (write the appropriate boolean expression for the loop control
condition, initialize any variables in that expression (loop control
variables) before the loop, update those variables correctly
inside the loop).
- Know what is meant by a count-controlled loop (and how to write one
especially using a for statement)
and a sentinel controlled loop (and how to write one).
- Be able to perform common looping subtasks -- summing, counting,
finding averages, finding products,
finding max and min values. Be able to use a loop
to go through a string character by character and do something such
as count a particular type of character or find the first character
after a blank. Be able to use a loop to ensure valid input (keep
making the user enter values until the value is in the correct
range).
- Be able to write and understand complex loops containing method calls,
conditions, and other loops (nested loops).
- Objects and Classes (Sections 3.1, 5.1 - 5.8, Labs
3 and 8 - 10,
class notes and handouts - All Self-Review Questions in Chapter 5,
except 5.5 on page 224 are good review.)
- Understand the difference between objects and primitive values, including
the difference in how they are stored (directly vs. references).
- Be able to create (instantiate) an object given the type signature
of one or more constructors of the appropriate class.
- Be able to use an object appropriately given the type signatures and
reasonable documentation for its methods.
- Understand the meaning of the public and private modifiers
and when each is appropriate.
- Understand the meaning of encapsulation (related to the
idea that an object should be self-governing) and how visibility
modifiers are used to enforce it (specifically understand what parts
of the class should be private and what should be public and how
doing that enforces encapsulation).
- Understand the concepts of attributes and behaviors
(or operations) of objects and how these relate to
instance variables and methods in the classes we write.
- Understand the difference between instance data (variables)
and local data (variables).
- Be able to write a class given a description of the capabilities required
of it.
- Know what an alias is and what garbage is! (Section 3.1)
- Understand the difference between static and instance variables, and
when each should be used. Understand why we often make constants in a class
public and static and how a client program can access them.
- Know what the reserved word this is.
- Methods (Chapter 5 but especially sections 5.4,
Labs 3, and 8 - 10, class notes
and handouts)
- Be able to write a method to perform a given task.
- Know what a constructor is and how a constructor differs from other
methods (when a constructor is executed and other differences). Be
able to write constructors.
- Understand the role of the toString method - what it does
and how it is used implicitly when an object is included in a print
statement. Understand what happens if you try to print an object
for a class that does not have a toString method.
- Understand all components of a method's signature -- public/private,
static/instance, return type, method name, formal parameters.
- Understand what it means for a method to return a value, and be able
to both write and use such methods. In particular, understand the
difference between a method that has void return type and one that
returns a value.
- Understand the difference between formal and actual
parameters.
- Understand the scope of identifiers - where formal parameters
can be referenced, where local variables can be referenced,
where instance variables can be referenced. (pp. 170-1, 188-190)
- Understand the difference between static and instance methods, how each
is accessed, and when each should be used. (Section 3.6, the Math class,
Self Review Question SR 5.11 on page 224)
- Understand what it means to say a method is overloaded. Be able
to explain how overloaded methods can be distinguished from each other.
- Arrays (Chapter 7 (except Section 7.5), Labs 11 and 12, class notes,
quizzes)
- How to declare and initialize an array (both of primitives and objects), including
the default values of various types, and array literals.
- Be able to iterate over an array to perform actions such as, average, min, max,
sum, printing, finding, and converting to a string.
- Understand how arrays are stored in memory and how they are passed as
parameters to methods.
- Know how to store a variable number of objects in an array (i.e. use a counter
to record how many elements are in the array, and expand or contract the array as
needed.)
- How to create and use multidimensional arrays including ragged arrays.