Sections 0101, 0102, 0103 and Honors, Fall 1995
Tuesday September 19, 1995
Assigned Reading: 3.1 - 3.3
Handouts (available on-line):
Project 1
Topics Covered:
- We examined a for loop that prints out the multiples of 3
from 3 through 30.
Program
and sample run.
- While loops, several ways of adding a list of
numbers until the user enters a zero:
- We discussed several
indentation styles.
- Some simple programs using an if statement.
Testing an input integer to check if it is even or odd:
Program and sample run.
Testing an input integer to check if it is positive, negative
or zero: Program and sample run.
- A very common bug is using one = instead of ==
to test for equality in an if statement. A seemingly
correct program can produce strange results.
Program and sample run.
- Discussed Project 1.
Last Modified:
Wed Sep 20 10:19:01 EDT 1995
Richard Chang, chang@gl.umbc.edu