Types of questions
|
- factual knowledge: TRUE/FALSE, multiple choice
TRUE or FALSE: The three main components in the von Neumann architecture are
the CPU, memory, and input/output devices.
- conceptual understanding: short answer, discussion
Can a Java class have more than one constructor? If so, describe an insteance where
mulitpile constructors might be useful. If not, explain why multiple constructors would not make
sense.
- synthesis and application: explain/debug code, trace/modify code
Modify the provided Die class so that each die has a color.
You will need to specify the color when you construct a Die object, and there should also
be an accessor method that allows you to access the color of a Die object.
|
Course Material
|
Overview & history
hardware vs. software
historical generations
mechanical -> vacuum tube -> transistor -> IC -> VLSI -> parallel & networks
evolution of programming
machine language -> assembly language -> high-level language
Programming in Scratch
programming concepts
simple actions: move, turn, next-costume, ...
repetition: forever, repeat, ...
conditional execution: if, if-else, repeat-until
logic: =, >, <, and, or, ...
arithmetic: +, -, *, /, ...
sensing: touching?, key-pressed?, ...
variables: set, change-by, ...
coordination: broadcast, when-I-receive, ...
object-oriented concepts
class = sprite template
object = sprite instance
fields = properties of a sprite (e.g., size, location, direction, ...)
methods = blocks/scripts that defined actions
parameters = values entered in boxes (e.g., turn ? degrees)
Using Java classes
loading a BlueJ project, creating an object, inspecting an object's state
calling a method, parameters, data types (String, int, double, ...)
Java class definitions
fields define state; constructors initialize; methods implement behaviors
public (class/constructor/methods) vs. private (fields)
accessor vs. mutator methods, void methods
comments (/** ... */ or // ..)
variables and memory
fields vs. parameters vs. local variables
primitives vs. objects
Java statements
System.out.print, System.out.println, + operator
assignment statements, expressions (using +,-,*,/)
increment/decrement, arithmetic assignments
mixed expressions, type casting
return statement
required in all execution paths of non-void method
if statement, if-else
comparison operators, cascading if-else
method calls
internal (one method calls another): this.METHOD(PARAMETERS)
external: right-click and select the method (in BlueJ)
methods are "units of computational abstraction"
|