This is an old revision of the document!
PHP's gd library is missing or unable to create PNG images
CMPU-101-04 Computer Science I and Lab. (Fall 2018)
Calendar
This calendar will evolve over the course of the semester. Typical entries will include links to the code we have studied in class, details of lab. problems and assignments, and sections of the textbook we covered in class.
Please note that Tuesday, 11th December and Wednesday, 12th December have a Thursday and Friday schedule.
Wk. | Tuesday |
Thursday |
Friday |
I |
Welcome and Introduction. |
Setting up a Computer Science (CS) department account. Introduction to the drRacket program. Poking the computer & seeing what happens. |
Creating directories with mkdir . Moving between directories with cd . Listing files with
ls . Your first program in Scheme. Running, saving and loading a program.
|
II |
Poking the computer (a second time). Data types. Evaluation of symbols to their definitions. The importance of parentheses. First explorations of Scheme's computational model. |
Reviewing data types. Review of Scheme's computational model ('evaluate and apply'). The output of a function. The printf command and side-effect printing. Line breaks and substituting into printed text.
What lambda does.
|
|
III |
Using predicates to answer yes/no questions. Arithmetic predicates. The multipurpose eq? function.
Shielding a datum from evaluation using the quote function, and its abbreviation. Beginning conditionals
and the if statement.
|
A brief review of if . Using cond for more complex situations, including the use of
else . Contracts, how to write them and why they are important.
|
|
IV |
Introducing recursion. Infinite loops and how to avoid them. The factorial function
(take 1).
|
Recursion, part 2: the Fibonacci sequence. |
|
V |
Return of conditionals. Introducing boolean operators and , or
and not , and their "truth tables".
|
Review of boolean operators and "truth tables". Review of predicates. Writing predicates without if or cond . Introducing non-empty lists. first and
rest .
|
|
VI |
Review of how if and cond can be interchanged with and and or . Constructing lists with cons .
|
MIDTERM REVIEW. Please bring questions & subjects to review. |
IN-CLASS MIDTERMCovers all material explored to date.5> |
Saturday, 13th to Sunday, 21st OctoberAUTUMN BREAKHappy holidays! :-) |
|||
VII |
Individual Reviews. |
The Default Rule, formally ('evaluate and apply'). Built-in functions vs. Special Forms; how special forms do not follow the Default Rule. The built-in eval function & how drRacket applies it at each step.
|
Introducing tail recursion and accumulators. The 'function box' as an analogy for drRacket's processing of code. Wrapper functions and writing contracts for them. |
VIII |
Brief review of accumulators and wrapper functions. Returning to lists and list recursion. |
List recursion continued. Passing a function as an input to a function. Mapping: applying the same function to every element in a list. Skipping items in lists. |
|
IX |
Nested lists. How to recursively explore nested lists. if to cond . Adding a variable to store
the player's guess in two ways: first with define and then by using another wrapper function.
|
Local environments. (And multicoloured candy apples.) The let special form: syntax and evaluation, and its
similarities to functions using lambda . The let* special form.
|
|
X |
Review of list operations with cons . Review of let and let* . Defining recursive local
functions with letrec* .
First look at the set! function.
|
Destructive programming. Changing the values of variables with set! . The while function, which lets us
loop any number of times. The dotimes function, which loops a fixed number of times.
|
|
XI |
Review of loops using dotimes . Using the counting variable of an outer loop as input to the counting variable of an inner loop.
|
No class! Happy Thanksgiving! | |
XII |
|
|
|
XIII |
|
|
IN-CLASS FINALFocuses on material since midterm,but covers all material. |
XIV |
Class |
Lab. |
No class! End of classes :'-( |