home—info—lects—labs—exams—hws
D2L—tutor/PIs—zoom (snow day)
Object120 + its docs—java.lang docs—java.util docs
exam02 topics
-
Loops (as per hw03, Credit-card numbers):
The syntax of while and for;
Initializing and declaring variables for loop-control and/or an accumulating an answer.
-
Arrays (as per hw04, array-practice):
-
How to write their type
(declare a variable to hold an array,
or a parameter which is an array,
or a function which returns an array.)
-
How to allocate an array, with new:
both an array holding specific values,
as well as an array holding (say) 93 values.
-
Looping over an array, either to initialize its values,
or to search for/process its values.
-
Functions that take in an array;
-
Functions that return a new array (perhaps based on the input).
-
void functions that take in an array(-reference), and assign-to (
mutate
) its elements.
-
Objects:
-
A way to group several pieces of data into one single
object
(a compound datum, that has several fields
).
-
Declaring the fields of a class;
-
Creating objects of a class, by calling the constructor
-
Syntax for writing (and calling) a constructor.
-
writing a function that takes in an object (as a static method, and then non-static)
-
writing a function that returns a newly-created object (as a static method, and then non-static)
-
Calling non-static functions (object-dot-functionname-arguments)
-
Writing non-static functions (an implicit parameter this)
-
getter- and setter-methods
Previous topics
(These are all still fair game;
many of the particular skills here are subsumed by the above.)
- The following standard built-in types in Java, and when to use them (give an example):
int,
double,
boolean,
char,
String.
-
Terms:
type
,
signature
,
argument
,
parameter
,
-
Examples, syntax, and why we use each of the following:
-
calling a function
e.g.: write an expression that calls to substring;
write a call to buffetPrice;
write n expression
-
function signature (that is, declaring a function)
-
the return statement
-
the syntax of if-else; if-else-if.
-
How to declare a variable.
-
How to initialize a variable.
- While loops
- How to compile (javac, java)
- naming conventions
(name a function for ____________;
class-name (starts with a _________) , named-constant (ALL_CAPS)).
To practice:
solve any of the suggested problems on recent lecture,
or any of those suggested at the bottom of a recent lab.
(The lab problems, if you include main
interactively reading
from a Scanner,
will use 2-3 functions total.
Think about how to break the problem down into a helper functions.)
You will be provided with the summary documentation for any built-in Java methods
you might need
(String, java.util.Scanner, java.util.Random).
home—info—lects—labs—exams—hws
D2L—tutor/PIs—zoom (snow day)
Object120 + its docs—java.lang docs—java.util docs
 This page licensed CC-BY 4.0 Ian Barland Page last generated | Please mail any suggestions (incl. typos, broken links) to ibarland radford.edu |
 |