CS199 Computer Science for Beginners  -  Spring 2009

Exercise 4    Due: Thursday, May 7, 2009 at Midnight

See below for instructions about which Python programs you need to send me by e-mail.

Be sure to name your files: Smith-2.py (if your last name was Smith and you were submitting exercise 2).  Etc.

Be sure to put comments in your program at the beginning that include your name, the Programming Exercise number, and a brief description of what your program does.  Put comments throughout your program to indicate what is happening.  Use informative names for your variables and your functions.

Remember: my e-mail address is lmd with the “at” symbol followed by cs.pdx.edu.

 

Do the following exercises in class on Thursday, April 30, 2009:

Ch. 4: Discussion: 3, 4

Write a program that reads each line in a text file.  Print out each line that you read from the input with one extra newline character at the end of each line.

Write a program that reads a text file and prints it out backwards.  That is, print the last line in the file first, then the next to the last line, and so on until you get to the first line of the text file.

Programming assignment: please turn these programs in:

Ch. 4 Programming Assignment 13

Ch. 4 Programming Assignment 15