CS 21: The Imperative Paradigm: UNIX and C

Spring Semester 1999
Swarthmore College
Professor Jim Marshall

Course Description

This course introduces students to fundamental ideas in computer science and software engineering using the C programming language and the UNIX operating system environment. Class periods will consist of a combination of lectures and hands-on interaction at the computer. Topics to be covered include Von Neumann computer architecture, overview of the UNIX operating system, elementary UNIX tools, the Emacs editor, UNIX shell programming, modular software design, recursion and iteration, sorting and searching, abstract data types and their representations, lists, stacks, queues, informal analysis of algorithms, and a thorough introduction to C programming, including control structures, functions and procedural abstraction, libraries and modules, arrays, pointers, string manipulation, file processing, and records.

As a Science PDC, we will be paying particular attention to writing, especially with regard to programs and documentation. Your homework grade will be strongly influenced by the legibility of your code, so it is very important to develop a clear, logical, aesthetically pleasing programming style, making judicious use (but not overuse) of comments, whitespace, well-chosen variable names, and a consistent indentation style. There will be numerous programming assignments illustrating the concepts covered in class. The only effective way to learn the material and pass the exams is to consistently do the homework.

Textbooks

Contact Info

Office Hours: Tuesdays and Thursdays 2:00-4:00pm, and by appointment.
Office: Sproul Observatory Room 6
Office Phone and Voice Mail: 328-8665
E-mail: marshall@cs.swarthmore.edu (or jmarsha1@swarthmore.edu)
If you need to see me but can't make it to my office hours, please contact me by e-mail or leave a message on my voice mail.

Grading and Homework Policy

25% Exam 1 (Tuesday, February 16, 7:00-9:00pm)
25% Exam 2 (Tuesday, March 30, 7:00-9:00pm)
25% Final Project
20% Homework
5% Class Participation

Homework Policy

We will be using the GNU C compiler on the computer science Suns. Homework will generally be assigned on Tuesday afternoons via e-mail and will be due the following Sunday by midnight. You will turn in your homework assignments electronically, using a special handin program (to be explained in class). Late homework is not accepted. Even if you miss a deadline, you are strongly encouraged to complete the assignment anyway, since this really is the only effective way to learn the material.

Because many students feel they learn more through collaboration, you may work jointly with one other person on each assignment (although you may work alone if you wish). No more than two people should work together. If you work with someone else, you must submit a single, joint assignment with both names clearly indicated at the top of your program file(s). Both individuals will receive the same grade for that assignment. Under no circumstances may you hand in work done with (or by) someone else under your own name. If in doubt, credit the person(s) from whom you got help. Your code should never be shared with anyone other than your partner.

Typically, each assignment will consist of several separate programs. Only one of these programs will be graded (you will not know which one in advance). Solutions will be handed out in class for the remaining programs. Homework assignments will be given letter grades according to the criteria shown below. Note that a program that works 100% correctly gets a B. In order to get an A, your program also needs to be clearly organized and well-documented (but this doesn't mean over-documented!).

A correct, logically designed, well-documented, efficient
B correct, but has stylistic problems
C partially correct
D does not compile or execute

If there are known problems with your code, you should describe these problems in a comment at the top of your program file.

Weekly Course Schedule and Reading Assignments

Note: You will get the most out of the class time if you do all of the week's reading PRIOR to the first class meeting of that week.

Week 1 (1/18-1/22): Introduction to UNIX, logging in, mail, editing, man pages, introduction to writing, compiling, and executing C programs (Reading: C book chapters 1-2, UNIX book chapters 1-4)

Week 2 (1/25-1/29): Programming idioms, control structures, output (Reading: C book chapters 3-4)

ADD/DROP PERIOD ENDS Friday, 1/29

Week 3 (2/1-2/5): Debugging, functions and procedural abstraction (Reading: C book chapter 5)

Week 4 (2/8-2/12): Algorithms, iteration, and recursion (Reading: C book chapter 6, section 17.1)

Week 5 (2/15-2/19): EXAM 1, libraries and graphics (Reading: C book chapter 7)

Week 6 (2/22-2/26): Random numbers, characters, and strings (Reading: C book chapters 8-9)

Week 7 (3/1-3/5): Modular development, makefiles, advanced UNIX (Reading: C book chapter 10, UNIX book chapters 5-7)

LAST DAY TO WITHDRAW Friday, 3/5

* * * S P R I N G * * * B R E A K * * *

Week 8 (3/15-3/19): Advanced UNIX continued, arrays (Reading: C book chapter 11)

Week 9 (3/22-3/26): Searching, sorting, order notation (Reading: C book chapter 12, section 17.3)

Week 10 (3/29-4/2): EXAM 2, pointers and call-by-reference (Reading: C book chapter 13)

Week 11 (4/5-4/9): Pointers, strings as pointers (Reading: C book chapters 13-14)

Week 12 (4/12-4/16): File processing, records (Reading: C book chapters 15-16)

Week 13 (4/19-4/23): Abstract data types, FINAL PROJECT ASSIGNED (Reading: C book section 17.2)

Week 14 (4/26-4/30): Abstract data types, discuss final project

Week 15 (5/3-5/7): UNIX shell scripting

FINAL PROJECT DUE FRIDAY MAY 14