|Types of questions
- factual knowledge: TRUE/FALSE, multiple choice
TRUE or FALSE: In Scratch, it is possible for sprites to coordinate their actions by sending and receiving broadcasts.
- conceptual understanding: short answer, discussion
The history of computers can be divided into generations based on advances in computer technology. Describe one such transition. Be sure to name both the old technology and the new, and describe specific features of the new technology that helped to make computers faster, cheaper, and/or more reliable.
- synthesis and application: explain/debug code, trace/modify code
Consider the folowing Python function:
def mystery(a, b):
while a > b:
a = a + 2
How many lines of output would be printed as a result of the call mystery(2, 11) ?
Overview & history
hardware vs. software, von Neumann architecture
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, ...
Programming in Python
Python interpreter, IDLE shell
numbers (int, long, float), operators (+, -, *, /, **, %)
strings, concatenation (+)
variable names, naming conventions, reserved words
assignment statements, shorthand assignments
parameters, return statements, doc strings
built-in functions (print, abs, max, min)
modules, import statement
random module (randint, choice), math module (sqrt, floor, ...)
if statement, Boolean operators (<, <=, >, >=, ==, !=, and or, not)
if (1-way), if-else (2-way), cascading if-else, elif (multi-way)
for loops, counter-driven
range function, sums & counters
while loops, condition-driven
infinite (black hole) loops