|
CMPT 120: Assignments
Home
|
Schedule and Lecture Notes
|
Labs
|
Assignments
Here are links to some code samples I've used in lecture that aren't in the notes. Here's a link to a bunch of code samples from the study guide along with a couple from a previous 120 course.
Zero to Ten check: Demonstrates use of a boolean variable
Weight Conversion: Demonstrates if-elif-else structure
Student Grade Calculator: Demonstrates use of functions
Student w/o functions: Above example if functions weren't used
Student again: Function with no input or output
Name Format Check: Demonstrates use of Boolean function in a while condition.
Student Info: Demonstrates use of Lists.
Writing Student Info to a File: Demonstrates output to comma-separated values file.
Reading Student Info from a File: Demonstrates input from csv file.
Recursive Functions: A couple recursive functions with output to help clarify the recursive process
Chris Schmidt, last updated June 25, 2007 |