Programming and Problem-Solving
Computer Science 35
10:00 MWF Peter Suber
Dennis 214 Spring 1996-97

This is a first course in programming. A course in programming is not a course in logic, mathematics, or engineering. It is a course in thinking.

Underlying our approach to this subject [programming] is our conviction that "computer science" is not a science and that its significance has little to do with computers. The computer revolution is a revolution in the way we think and in the way we express what we think.
Harold Abelson and Gerald Jay Sussman

First, we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute.
Harold Abelson and Gerald Jay Sussman

Every computer program is a model, hatched in the mind, of a real or mental process....Thus even though our programs are carefully handcrafted discrete collections of symbols, mosaics of interlocking functions, they continually evolve: we change them as our perception of the model deepens, enlarges, generalizes....The source of the exhilaration associated with computer programming is the continual unfolding within the mind and on the computer of mechanisms expressed as programs and the explosion of perception they generate.
Alan J. Perlis

There is no reason to suppose machines have any limitations not shared by man....[My] main to introduce the student to the concept of effective procedure --a technical idea that has crystallized only fairly recently but already promises to be as important to the practical culture of modern scientific life as were the ideas of geometry, calculus, or atoms.
Marvin Minsky

The course has no prerequisites. It presupposes no experience in programming, or even with computers. It presupposes no mathematics except the elementary arithmetic you did in grade school. The view that computer programming is limited to number crunching is a damaging stereotype that we will overcome in the course. Nor is the course designed merely for prospective science, mathematics, or CS majors. You can feel Perlis's "exhilaration" in programming whatever your field of interest.

On the other hand, the course goes considerably beyond "computer literacy". We will not focus on how to use popular software like word processors, spreadsheets, and data base managers. Instead, we will actually learn to write software of our own. If you are merely interested in "computer literacy", then consider taking CS 20 instead; it satisfies the computer requirement for our management major, but does not receive science distribution credit. This course, on the other hand, earns a distribution credit as a non-laboratory science.

While we will work with only one language (Pascal) and only one kind of computer (the PC), the habits of thinking you will learn in this course will help you with any programming language on any computer and, most importantly, with problem solving independently of computation.

The course stresses programming methods and problem solving through Pascal, as opposed to Pascal's syntax as an independent subject of study. Hence, homework will consist of actual programming projects. Expect to write a program, or to modify and expand a program, several times a week during the course.

I've created a course homepage containing a collection of hand-outs and course-related web links at If you find any other relevant links, let me know and I'll add them to the collection.

What to buy
  1. Doug Cooper, Oh! Pascal!, third edition, W.W. Norton & Co., 1992.
  2. Two 3.5-inch, high-capacity disks. These are for sale in the bookstore.

    We will use Turbo Pascal 7.0 (which I'll call 'TP') as implemented for the IBM PC and compatibles. But you need not buy this software. It is running on the PCs in the PC Lab in the basement of Wildman Library.


Pages cited for a given day refer to Cooper's textbook; they will be discussed or presupposed that day in class and should have been read in advance. Pages in parentheses are recommended but not required. This pace is only approximate. When we start a new chapter, finish it as soon as you can and feel free to use anything from it in your exercises and projects which are assigned during that unit. In class, we may finish the sub-section assigned for a given day quickly and move along. All assignments are due at class time.

Week 1. January 13-17

Week 2. January 20-24 Week 3. January 27-31 Week 4. February 3-7 Week 5. February 10-14 Week 6. February 17-21 Week 7. February 24-28 Week 8. March 3-7 Week 9. March 10-14

Week 10. March 17-21

Week 11. March 24-28 Week 12. March 31 - April 4 Week 13. April 7-11 Week 14. April 14-18

Week 15. April 21-25

Week 16. April 28 - May 2

I've stuck in a review day every now and then. Here are some of my ideas on how to use them; let me hear yours.

Work summary


There are two kinds of programming assignment: exercises and projects. These correspond roughly to drills and papers in other courses. Both are to be finished programs that compile without errors and run without crashing. The exercises ('drills') are for practice in Pascal syntax, and so are intended to be easy. Each one should take no more than two hours after you have mastered the relevant reading.

The projects are programs of a more challenging variety. They are more adventuresome, creative, and polished than exercises. They should also take longer. In addition to functioning properly, projects should be well-organized and well-documented.

Exercises are for your benefit alone; I will not ask you to turn them in. Projects are graded assignments. Projects will almost always require the syntax you have recently been practicing in the exercises.

In many cases, a project assignment will offer you several levels of challenge. Everyone will be required to do the minimal or core assignment. Your grade will not suffer if you do nothing more. However, try the optional enhancements whenever you have the time.

With approval, you may substitute a large project of your own devising for the last two or three projects. If you plan to take advantage of this option, we should start to talk about your project proposal by Week 10 or 11.

What to turn in

When a programming project is due, you should turn in (1) a printout of the code, called a listing, and (2) a printout of a run of the program. In an early hand-out I'll provide detailed instructions for printing the listing and a sample run; we'll practice them together in the PC Lab soon.

Put your name on your printouts. It is good practice to include your name as a comment at the top of each of your program files.

As the course goes on, your personal Pascal library of useful procedures and functions should grow larger. If you use code from your Pascal library in a homework program, then (1) insert comments liberally to tell the readers of your program in which file the actual code statements are to be found, and (2) hand in a printout of the library file, or its relevant parts, with the program.

Do not turn in assignments on disk or by email unless I ask you to. However, I have a PC and Turbo Pascal in my office. If you come to my office to talk about a specific problem, then bring your disk along. It could help us both.


Drop in to my office during any of my posted office hours to talk about any aspect of the course. If my hours are not convenient for you, we can usually arrange to make an appointment for another time. I am very accessible by email.

If you want more practice than my exercises and projects demand, you should do any of the exercises in OP that interest you. Feel free to bring your exercises (whether mine or OP's) in to me to talk about how they work or why they don't.

Don't overlook these features of our textbook when you need help:

There are also several sources of help outside our textbook:

I will try to hire expert student assistants as tutors. If I do, they will see each of your assignments before I do and write comments on them. I will go over their work and yours, and assign the final grade in every case. If I can hire suitable students, they will hold regularly scheduled tutorials or office hours in the PC Lab that complement my own to give you more opportinities for one-on-one assistance.

A final note. You will save lots of time and have more fun in the course if you can touch-type. If you can't touch-type already, try to teach yourself how to do it and practice during the term. Or consider getting a book to help you learn. This skill will help you enormously in this course and in most others as well. (Computers and keyboards are here to stay.)

Working with a Mac

It will be difficult but not impossible to use a Macintosh for this course. Earlham has public Macs in the Mac Lab on the second floor of Dennis Hall. Those machines are running the Code Warrior Pascal compiler. If you have your own Mac and want to use it, then you'll have to buy your own version of that or some other Pascal compiler. Pascal compilers for the Mac are also available at a student discount; again, if interested, contact Beth Shank-Daggett (email shankel) in the Computing Center, extension 1282.

However, all instruction in this course will be on Turbo Pascal for the PC. You will have to teach yourself the Mac compiler and its development environment. If you have trouble at any point, then you will have to read the manuals and work it out for yourself. Moreover, you will have to learn Turbo Pascal for the PC anyway. The reason is simply that if a need for support and instruction leads you to switch back to Turbo Pascal in the middle of the semester, then neither you nor I will have the time to review the first week of training and the many subtler points made thereafter. Therefore, see me before committing yourself to the Macintosh for this course.

If you would like to use a Mac but these difficulties dissuade you, remember that this course is offered every semester and usually uses the Mac.

Lateness, extensions

As in other language courses, our material is strongly cumulative. New units build on old units so that falling behind can snowball. Give yourself a fair chance; keep up to date on the reading and assignments.

I give one free day of lateness for each piece of work (other than the final project when the end of the term limits my freedom to be lenient). After that I take off one-half a grade (5 points) for every day of lateness. If you want an extension, talk to me in advance of the due date. If you miss a scheduled exam without prior permission, you will get an NP.

When the computers in the PC Lab are down (defunct, kaput, shut down, broken, unplugged, melted, smoking), then I will automatically adjust deadlines or give extensions. If you are using the Macs in the Mac Lab, I will make similar adjustments. If you are using your own computer and have a problem, I expect you to turn to the public machines before asking for an extension.

Note that all public computers at Earlham are busy Sunday nights (for Monday assignments) and at the end of the term (for term papers). This is foreseeable, so plan around it. Also note that the PC Lab closes at midnight most days. The unavailability of the public computers due to posted closing times and foreseeable competition for access to them are not good excuses for late work and will not justify extensions.

Because projects should be polished programs, and because we have so many of them (at least compared to papers in a writing course), I will not be able to accept rewrites. So do them beautifully the first time.


I encourage you to talk about the problems you encounter in this course, and the ingenious solutions you discover, with your peers, as you would in any other course. However, it is easier in other courses than in this one to tell when your friends or tutors have gone beyond discussion to over-eager assistance that deprives you of authorship and becomes plagiarism. If you need help with a specific topic, say field widths, it is legitimate for a friend or tutor to explain them by coding an example unrelated to the one you need in an assignment, or by explaining examples from the textbook. Use the understanding you gain from those examples to write the code you need. Or practice with many such unrelated examples until you do understand. But do not ask a friend or tutor to help you write the very code you need for an assignment, or allow them to do so; that is plagiarism. If you need help deciding whether a solution is your own, we can talk.

Where am I?

My office is Carpenter 328. My office phone number is 1214. Dee Airgood, the Philosophy Department secretary, is at 1422; she can take messages for me. My email address is peters. My home page is

My home phone number is 962-2533 (dial WOBBLED). Please don't call me at home before 9:00 am or after 9:00 pm, unless there is an emergency. But if there is an emergency, don't hesitate to call. If you call my home phone during the day, you can leave a message on my tape recorder.

Questions about the operation of the network in the PC Lab, and reports of malfunctions, should go to the Computing Center, not to me. First try Josh Albertson at extension 1437 (email alberjo). Then try the Computing Center general number, extension 1527.

Grade Weights

Your final grade depends on these elements with these weights:

projects (x 6)55% (9.16% apiece)
exam #115%
exam #220%
evaluation form0%

These percentages are only approximate. I will weigh projects later in the term more heavily than earlier projects. Participation includes attendance and preparation for class. You must submit all assigned work to pass the course.

I will evaluate your programs on several criteria. I will elaborate on these in class, but they include:

This is syllabus is based on the experience of many different members of the computer science faculty at Earlham College. I have borrowed phrases and ideas from several of my predecessors.

Ribbon] Peter Suber, Department of Philosophy, Earlham College, Richmond, Indiana, 47374.
Office phone 765 / 983-1214. Copyright © 1997, Peter Suber.