|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
- 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.
Overview & history
hardware vs. software
mechanical -> vacuum tube -> transistor -> IC -> VLSI -> parallel & networks
evolution of programming
machine language -> assembly language -> high-level language
Programming in Scratch
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, ...
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
assignment statements, expressions (using +,-,*,/)
System.out.print, System.out.println, + operator
required in all execution paths of non-void method
internal (one method calls another): this.METHOD(PARAMETERS)
external: right-click and select the method (in BlueJ)