CPS 202 - Syllabus

CPS 202 (Burlington)
Spring, 2002
Steve Mount
Pine Street 105

Computer Programming: C

Text:
C Programming: A Modern Approach K.N. King

The Class:
The Class meets on Mondays, every week, starting January 21, 2002. We will meet in room 105 in the Pine Street building on the Burlington campus. Class time is from 3:00p.m. to 5:45p.m.

Contacting me:
I can be reached via email almost anytime: steve@saltyrain.com. Homework, quizzes, and the exam MUST be submitted via the Submit Page or, as a backup, to homework@saltyrain.com. Home phone: (802) 860-3924 after 6p.m.

Course Objectives:
The successful student will be able to:

Course Requirements:

  1. Tardiness is frowned upon, as it takes away from the learning process. If you must be late, please try to enter quickly and quietly.
  2. Missing more than two classes could put you too far behind in hearing lectures to allow you to succeed. Absences may affect financial aid.
  3. The lectures are designed to be heard without having read the chapter before hand. Those who read the chapter prior to class may have an easier time understanding the lecture, however. There will be time in each class to discuss the prior week's lecture.
  4. Be sure to bring your books with you to class, as we will refer to them often.
  5. There will be one ten-minute break during class time.
  6. Homework is given as outlined in this syllabus. Homework must be submitted via the Submit Page, or, as a backup, by email to homework@saltyrain.com. To count towards your homework grade, it must be received before class time. Except under pre-arranged circumstances, late homework will not count towards the final grade. All source code sent MUST clearly identify the author's name. If sent via email, homework must be submitted in plain text files (no Word files). There are 11 homework assignments. To get full credit, 10 must be submitted. Homework is not graded - it is checked and reviewed, and any competent attempt to solve the problem will count.
  7. There will be four quizzes in the class. All quizzes will be take-home. The quizzes must be submitted via the Submit Page, or, as a backup, by email to homework@saltyrain.com. If submitted via email, the files submitted must be plain text (no Word files). Late quizzes will not be accepted unless under pre-arranged circumstances.
  8. There will be one mini-quiz. The mini-quiz will be taken in class. The mini-quiz will be submitted via the Submit Page. If something prohibits the web site from being used on the day of the mini-quiz, the mini-quiz will be submitted via a method determined on that day. There will be no make-ups for the mini-quiz unless pre-arranged.
  9. There will be one final exam. The exam will be take-home, and must be submitted via the Submit Page, or, as a backup, by email to homework@saltyrain.com. If submitted via email, the files submitted must be plain text (no Word files). Late exams will not be accepted unless under pre-arranged circumstances.
  10. The quizzes will count as 40% of your grade. The mini-quiz will count as 10% of your grade. The final exam will count as 30% of your grade. Homework counts as 20% of your final grade.
  11. I do not grade on a curve. Grades will be determined by a point system; You can get up to 1000 points by the end of the semester - homework, for example, will count towards 200 of those points. The following scale will be used: 90-100% of the point total = A; 80-89% = B; 70-79% = C. Less than 70% is an N.

The Classes:
We will be focusing on chapters 1 through 13 in the text. This provides time to go over one chapter per class, with one class for review and administration of the mini-quiz, and one final class for a discussion of C++ and for a final round-up.

Students should be sure to schedule time on a computer to work on the homework exercises. Access to a computer with a compiler is crucial to understanding the course. All CCV computers have a Visual C++ compiler, which can be used to work C code. If you have a computer at home, you will find it worth the time, money, and effort to buy your own compiler. Freeware compilers are available, but can be difficult to set up. Many book stores and computer stores sell book/compiler combinations that include an older version of a popular compiler. Cost is usually $30 - $50.

Students should complete as many exercises as possible at the end of each chapter. Certain of the exercises are assigned as homework that will be turned in for review. There is no substitute for typing in and running programs yourself.

Also, in general, there will be time to go over any questions the students have about the assigned reading and homework. At any time during the span between classes, please email me or phone with any questions. There is almost always time after class lecture to meet with me to go over questions one-on-one or to work on the next week's homework. Please take advantage of this time.


Week 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Date 1/21 1/28 2/4 2/11 2/18 2/25 3/4 3/11 3/18 3/25 3/29
3:30
4/1 4/8 4/15 4/29
Lecture for Chapter 1 2 3 4 5 -- 6 7 8 9 10 11 12 13 19
Homework Due (Chapter) - - 2 3 4 5 - 6 7 8 9 10 11 12 -
Quiz Due 1 MQ 2 3 4 Exam

Note: When a quiz or homework is due, it is due at the beginning of the class noted.


Class 1, January 21, 2001 - Chapter 1.

Our first class will begin with introductions, the course outline, and my expectations of you. We will look at the program we will be using to code our programs (Visual C++) and talk about alternatives to this program. We will discuss the use of the computers, my email address and web page, and any other little tid bits that come up. We will go over Chapter 1, what is C, its history, and its uses. If time permits, we will write a simple program and type it into the VC++ program to see how everything works.

Homework: Read chapter 1.

Notes for class 1

Class 2, January 28, 2002 - Chapter 2.

Chapter 2, C fundamentals. We will talk about the steps a compiler goes through to turn program source code into a running program. We'll look at the basic building blocks of every single C program, learn about the basic parts of a program, what a variable is and how to set it, and how to get information from the program user. The first quiz will be distributed.

Example code: dweight.c (page 19)

Homework: Read chapter 2. Complete Chapter 2 exercises 5, 7, and 9.

Notes for class 2

Class 3, February 4, 2002 - Chapter 3.

Chapter 3, Formatted Input/Output. One of the most basic things programs do is take input and spit back out as output after doing something with the input. In this class, we will look at printf, and its use as a formatter. We'll learn about escape sequences, and take a closer look at scanf.

Homework: Read chapter 3. Complete Chapter 3, #6. Complete quiz #1.

Notes for class 3

Class 4, February 11, 2002 - Chapter 4.

First, quiz #1 is handed in.

Chapter 4, Expressions. Here we learn what you all dread - how C handles math. (Math?!?) The basics are all here; addition, subtraction, multiplication, division, and something odd called mod. We'll learn why 1+1*2 is not 4, and how to make it so. We'll learn about lvalues and rvalues, increments and decrements, and other assorted oddities.

The second quiz will be distributed.

Homework: Read chapter 4. Complete Chapter 4, #3, 4, 5.

Notes for class 4

Class 5, February 18, 2002 - Chapter 5.

Chapter 5, Selection Statements. A program that can't make decisions is a very boring program. In this class, we go over ifs, elses, and switches. We'll look at equality tests, logical grouping, something fun called booleans, and when TRUE is false. And no, a dangling else is not programmer slang for something X-rated.

Homework: Read chapter 5 as needed. Complete Chapter 5, #8 and 9.

Notes for class 5

Class 6, February 25, 2002 - Break and Mini-Quiz.

Be prepared in this class to bring up any issues that you are not yet clear on. We can talk about any subject you wish, all the way back to why the heck this is called C anyway. I will be providing some examples from the homework of the right and wrong ways to do things.

In the final hour of class, a mini-quiz will be administered in class. There will be make-ups for the mini-quiz only in the most dire of circumstances.

Coding Style Standard

Homework: Reread chapters 1-5 as needed. Complete quiz #2.

Notes for class 6

Class 7, March 4, 2002 - Chapter 6.

First, quiz #2 is handed in.

Chapter 6, Loops. Some programming can be pretty mundane. The last thing a programmer wants to do is type the same mundane code over and over again. That's where loops come in. Of course, there can't be just one kind of loop, so C has three: for, while, and do. Each has its own particular use and its own unique syntax. And each has ways to break. If dangling elses didn't teach you to be careful when indenting, loops will.

Quiz 3 is distributed.

Homework: Read chapter 6. Complete Chapter 6, #8. Work on quiz 3.

Notes for class 7

Class 8, March 11, 2002 - Chapter 7.

Chapter 7, Basic Types. So far, we know about ints and floats. Well, you probably guessed that life can't be that simple. This class we learn about signed and unsigned, floating points, characters (and I don't mean me), we revisit escapes, sizeof, conversion, and type casting. We'll learn how to create our own types, and wonder why we ever would. We'll learn about deadbeef, a programmer favorite.

Homework: Read chapter 7. Complete Chapter 7, #9 and 10. Complete quiz 3.

Notes for class 8

Class 9, March 18, 2002 - Chapter 8.

First, quiz #3 is handed in.

Chapter 8, Arrays. Variables are great for holding things. But what if you want to hold 100 things, or 1000? Of course, C gives you a way to easily hold quantities of like information. We'll learn what an array is, how to locate data in an array, how to initialize and populate an array (remember loops?), and figure out how to draw a spreadsheet on the chalkboard.

Quiz #4 is distributed.

Homework: Read chapter 8. Complete Chapter 8, #2, 7, and 9.

Notes for class 9

Class 10, March 25, 2002 - Chapter 9.

Chapter 9, Functions. Believe it or not, we have been using functions since our first class. Finally, we find out what scanf and printf are, and how you can write your own nifty mini-programs. We'll learn how to prototype a function, how to declare it, and what to put in it. We'll learn how to send information to a function and how to get information out of a function. And just a little about recursive functions.

Homework: Read chapter 9. Complete Chapter 9, #2, and 4. Optionally, try #16. Continue to work on quiz #4.

Notes for class 10

Class 11, March 29, 2002 (3:30pm) - Chapter 10.

Chapter 10, Program Organization. In this chapter, we'll learn some of the consequences of having a program with functions. Namely, that we can now have two new kinds of variables: local and global. To top it off, we'll learn about static and automatic variables at the same time. Head spinning yet? Wait until you learn about blocks and scope.

Homework: Read chapter 10. Complete Chapter 10, #3, 4, and 5 (Code for the poker.c is available).

Notes for class 11

Class 12, April 1, 2002 - Chapter 11.

Chapter 11, Pointers. What is a pointer, what is that star mean (wasn't that multiplication?), and an explanation for the ampersand in the scanf function. We'll learn what indirection is, how to pass pointers to functions (and why), and how to return a pointer (... and why).

Homework: Read chapter 11 as needed. Complete Chapter 11, #4 and 5.

Notes for class 12

Class 13, April 8, 2002 - Chapter 12.

First, quiz #4 is handed in.

Chapter 12, Pointers and Arrays. You liked pointers and arrays so much, you get more. What is the relationship between a pointer and an array, and how do they differ? How to step through an array, and how to move a pointer. How to subtract pointers, and why you cannot add them.

Final exam is distributed.

Homework: Read chapter 12 as needed. Complete Chapter 12, #4 (a and b) and 13.

Notes for class 13

Class 14, April 15, 2002 - Chapter 13.

Chapter 13, Strings. We've touched on strings before, when we discussed arrays, but now we'll flesh out the topic. Strings can be manipulated in many ways: copied, added to, modified, printed. And much of what gets done in real programs uses strings. In one particular case, we'll see how strings are used to provide a program with a list of the "arguments" provided on the command line.

Sample code: readline.c: can be used in your own programs to read a line of data from the user

Homework: Read chapter 13 as needed. Complete final exam

Optional Homework: Complete Chapter 13, #5 (a and b).

Notes for class 14

Class 15, April 29, 2002 - Chapter 19.

I will go over some of the features of C++, the next generation of programming languages discussed in chapter 19. After this, we will turn in final exam and go over the answers to the exam.

Notes for class 15


Revised: 21 Dec 2001