CS113: Introduction to C (Spring Semester 1999-2000)

Some important data points

Who: Hubie Chen (hubes@cs.cornell.edu)
When: MWF 12:20 - 1:10p (January 24, 2000 - February 18, 2000, four weeks)
Where: Th 203
Buster, where are those office hours: Upson 5162
When are those office hours: Thursday 1:30-2:30p, and by appointment (note: these are subject to change)
Grading: S/U only.

News

2/15/00:

* Extra office hours on WEDNESDAY, Feb. 16 at 5 PM.

2/14/00:

* The second problem of homework #4 has been changed. Now, you must print out _all_ latin squares of size n.

1/27/00:

* For problem #1 (homework 1), you may assume that the user enters in at least two numbers.
* If you are having trouble keeping your output window open after your program terminates, try putting in a scanf command such as

scanf( "%d", &some_int_variable );
at the end of your main function. (I would appreciate it if you removed or commented out such scanfs before turning in your program!)

1/26/00: * Some compilers might not accept the declaration

void main()

Instead, try
int main()

and include
return 0;
as the last line in your main function.

1/25/00: When turning in assignments, please include FULL NAME and STUDENT ID.
One student has suggested ecampus as a decent place to purchase the books (decent in terms of relatively low prices/shipping time).
I will permit you to drop this class on February 2, but I am not permitted to allow you to drop after that.
NO office hours on Wednesday - sorry for the inconvenience.

Links

Homework 1 - due January 31
Homework 2 - due February 4
Homework 3 - due February 11
Homework 4 - due February 18
Optional: Extra Assignment - due February 24
Schedule

What you'll learn, prerequisites

Ideally, by the end of this course students will have mastered the fundamentals of the C programming language to the point where they can learn about C language features on their own by reading a book (e.g. Kernighan/Ritchie). In addition, by the end of the course students should feel comfortable writing simple C programs, and have working experience with all major C features.

I will assume that you have taken CS100 or an equivalent thereof.

Do NOT register for this course unless you plan to attend all lectures.

Textbook(s)

I recommend purchasing both of the textbooks for this course:

1. The C Programming Language, 2nd ed. Kernighan and Ritchie. Prentice-Hall, 1988.

2. C by Dissection, 3rd ed. Al Kelley and Ira Pohl. Addison-Wesley, 1996.

In this course, I plan to roughly follow the Kelley/Pohl text, but reading may be done from either book. I would like you to get Kelley/Pohl if possible. K&R is the quintessential C reference book. K&R is not the optimal choice in terms of a sole text for a first-time course in C, but is a good complement to an introductory-level textbook, in my estimation.

What exactly is it that y'all want me to do with these grey boxes?

To complete the assignments in this class you will need to use a C compiler. You are free to use the C compiler of your choice. However, I recommend Metrowerks Codewarrior (because it is widely available on campus, and it runs on both the Macintosh and Windows-based PCs). Codewarrior can be found on any of the Macs or PCs in any of the CIT labs (such as Upson B7, MVR G83, Sibley B8). Hal Perkins and David Pierce created a pair of introductory handouts that will help you get used to the Codewarrior programming environment. Unfortunately the Codewarrior tutorial was written for version 1.0 not version 3.0, but for now it is still a good place to start.

Introducton to the Macintosh (postscript)
Introduction to CodeWarrior (postscript)
How to use CodeWarrior on a PC, and more information on compilers

Useful and/or fun links, possibly related to C

The Int'l Obfuscated C Contest, decidedly not representative of the model of style you should pursue while taking this class
Yahoo's C Page
Stanford CS Education Library
Towers of Hanoi on the web

Assignments 'n Grading

There will be four assignments. They will generally be handed out on Friday and due the following Friday, but I may make the first one due on Monday. These assignments may become more involved towards the end of the course. No late assignments will be accepted. I will use the following scale to reduce your work to a mere single-digit number (constrained to be in the range 0-4 inclusive):

4 - Perfect. No mistakes.
3 - Very good. Some minor errors.
2 - Good. Everything attempted, but a major error may exist.
1 - Several questions omitted and/or significant errors revealing a lack of understanding.
0 - Insufficient effort.

I reserve the right to take one point for style, but I don't expect to do so except in extremely greusome cases. I find it difficult to focus on style given the 50:1 student-staff ratio of this course, but for the record, I consider style to be as important as functionality.

You are guaranteed to receive an S if you complete all four assignments with a score of two, and perform decently on any given quizzes. Failing to complete two assignments will result in a U. Students who do not fall into one of these two categories will be handled on an individual basis.

Working with others

You may discuss your work with classmates but the work you turn in must be your own. For starters, you should understand everything that you turn in. If you have any questions about this policy, please come talk to me. The Cornell University Code of Academic Integrity provides more details on these issues.

Thanks to Matt Harris and Tugkan Batu for allowing me to steal shamelessly from their course materials.