Examinable Topics
I will attempt to cover all the following topics on the final exam,
though not all topics will be given equal weight. For example, the
single most important skill is the ability to devise solution procedures
for problems in terms of sequence, selection (if
) and iteration (for
and
while
).
- Base skill: IPO programming: Using Python to calculate values of formulas, e.g. wind-chill, unit conversions.
- Core skill: Combining
if
,while
,for
to express algorithmic procedures. - Technique Packaging quantities using
//
and%
; pulling apart numbers using%
and//
. - Technique Formatting output using f-strings.
- Technique Input validation using
while
. - Technique Using counters in programs.
- Technique Using flag variables, i.e. Boolean variables that
record state, e.g.
while not done:
,if game_lost:
. - Core skill: Defining functions. Knowing how to do it, and knowing when to do it.
- Approach Using randomness to simulate events, e.g. four daughters, hockey series.
- Data representation: Representing things using lists, e.g. playing cards.
- Data representation: Creating and interpreting heterogeneous data structures (lists of lists, lists of dictionaries, dictionaries of lists, etc.), e.g. the cave system for Hunt the Wumpus.
- Technique Processing strings using string operations, as in the password checking program.
- Technique Processing lists, e.g. CD shuffle,
is_straight()
. - Technique Using vs changing lists, i.e. how to change a list in place, and how to avoid changing a list.
- Technique Converting lists to strings and vice versa.
- Data representation: Using and processing dictionaries, e.g. for counting.
- Data representation: File processing, e.g. the temperature data file.
- Approach Parameterizing code for generality. (And on a minor note, using 'constants').
- OOD object types → classes → attributes & methods (tell, ask)
- _OOP_concepts: Abstraction, Inheritance, Polymorphism.
- OOP Defining (base) classes, reverse engineering them when necessary.
- OOP Modifying a class via inheritance. Using inheritance to avoid code duplication.
- UML Creating class diagrams from code, and code from class diagrams.
- Software development:
- By hand → Pseudocode → Python
- Documentation
- Divide and conquer
- Design first; code second
- Incremental development
- Testing frameworks, including doctest strings.
- Problem domains: Playing cards, Tic-Tac-Toe, Hangman, Hunt the Wumpus.