Last modified: Thursday, October 29, 2026
switch statement
main function at the end;
describe_grade - which includes
two versions, one using the if-else-if
pattern and one using a switch
statement if statement
main function at the end:
abs_value - uses an
if-else
statement, and involves interval-style datanext_sound - C++ version of Week 4 - Lecture 2
Racket function next-sound,
uses the if-else-if pattern, and involves
enumeration-style dataporridge_pref - uses the
if-else-if pattern,
and involves interval-style dataif statement syntax,
and its semantics expressed as a flow-chart if statement with optional else
syntax,
and its semantics expressed as a flow-chart if-else-if pattern - an alternate approved
indentation for a common use of "chained" if
statements appropriate when choosing exactly ONE of 3 or more
choices,
and its semantics expressed as a flow-chart string
class' + operator,
a few more string class methods,
review clicker questions,
and a lab exercise
string class methods
string class bool
expressions involving C++ relational operators;
what is object-oriented programming; what is a class;
what is a method of a class, and what is the syntax for calling
it;
some functions involving string class instances;
intro to the string class + operator,
and to its length method
bool expressions main functions,
tested in the main function at the end;
its main function also includes some
additional playing-around with string
operator + and method length
pretty_name name_length .cpp file template INTO a
.cpp file
in the CS50 IDE at
https://cs50.devmain) functions
using the design recipe, including testing them in a main
function;
intro to the
idea of a compiler (as compared to an interpreter);
more CS 111 C++ coding standards, debugging tips,
and more
main functions,
tested in the main function at the end
circ_area
grade_in_range.cpp file template INTO a
.cpp file
in the CS50 IDE at
https://cs50.devcheck_within
and main demo prints to
standard output when that is redirected into a file
add-shape, another function allowing keystrokes to change a
big-bang world, here a world whose type is
a list of images
add-shape, which adds
an image to a list of images
based on a keystroke:
draw-images-randomly grab-strings add-shape map
function; a little more on BSL Racket's 2htdp/batch-io
module; two more functions that "walk through" a list;
and STARTED a function allowing keystrokes to change a
big-bang world whose type is
a list of images
map functiondraw-images-randomly grab-strings add-shape 2htdp/batch-io,
which provides some functions for file input and file output
len add1-list big-bang expression; review
clicker questions followed by a lab exercise
list type, and
introduced several built-in functions that work with lists
double-it big-bang's on-key clause;
intro to itemization data, and describing such
data using data definition
comments
draw-penguin-scenechange-elevation double-it big-bang world of type string
draw-string-world next-sound - copied here, because
used in an example expression
here change-world-string time-to-quit? cond
expression; another example of refactoring;
"falling" penguin example using
cond; discussion of interval-style data and
enumeration-style
data; walked through an example using enumeration-style data
cyan-star (copied from Week 2 Lecture 2)cyan-star-scene (copied from
Week 4 Lecture 1 version) bad-star-size? draw-penguin-scene next-sound and, or, and
not;
what is refactoring;
intro to BSL Racket's cond
(conditional/branching) expression;
intro to big-bang
function's stop-when clause
cyan-star (copied from Week 2 Lecture 2)cyan-star-scene (REFACTORED a bit from
Week 3 Lecture 2 version) banana-report scene data type;
example using the design recipe to write a function
that returns a scene instance;
intro to the big-bang function from the module
2htdp/universe
big-bang
at the end, it also defines the functions:
cyan-star (copied from Week 2 Lecture 2) cyan-star-scene check-within; some more useful Racket built-in
functions; intro to the concept of scope of
an identifier; two more examples of designing
functions using the design recipe: humboldt-logo
and doubt-it
humboldt-logo doubt-it check-expect; intro to writing your own
functions using the DESIGN RECIPE
triple cyan-star