The course described on this page ended December 15, 2005
You can download a .zip archive of this site at the link:
(Note that where any lab refers to a file in the directory /classes/f05/cs124,
there is also a link to a copy of that file in the archive; the
/classes/f05/cs124 directory itself is not included.)

CPSC 124: Introduction to Programming

   Department of Mathematics and Computer Science
   Hobart and William Smith Colleges

   Fall, 2005.

   Instructor:  David J. Eck  (

   Monday, Wednesday, Friday, 9:05 -- 10:00 AM
       Room Lansing 300

   Lab: Tuesday, 10:20 -- 11:45 AM
       Room Gulick 208

   Course Handout:

   Office Hours for Fall 2005:
              Monday     2:00 -- 3:00
              Tuesday    1:00 -- 3:00
              Wednesday  1:00 -- 3:00
              Friday    10:00 -- 11:00

Assignments and other information for CPSC 124
will be posted on this page as the course is taught
during the Fall term of 2005.

Lab Worksheets
Lab 1, August 30
Intro to Linux and Java
Lab 2, September 6
Using Predefined Subroutines
Lab 3, September 13
Branches and Loops
Lab 4, September 20
Introduction to Eclipse
Lab 5, September 27
Art(?) with For and Switch
Lab 6, October 4
Writing Subroutines
Lab 7, October 18
Red vs. Blue
Lab 8, October 25
Writing a Class
Lab 9, November 1
Events and Applets
Lab 10, November 8
Components and Networking
Lab 11, November 15
Lab 12, November 22
Partially-Full Arrays
Lab 13, November 29
Two-Dimensional Arrays
Lab 14, December 6
Work on Final Project
Programming Assignments
Assignment 1:
A Random Math Quiz
Assignment 2:
Mosaic Draw
Final Project
Test and Quiz Answers
Quiz 1, September 5 Quiz 2, September 16 First Test, September 30 Quiz 3, October 17
Quiz 4, October 28 Second Test, November 4 Quiz 5, November 18 Quiz 6, December 7

Some Useful Links

Final exam: December 15

The final exam for this course will be at 7:00 PM on Thursday, December 15. It will be held in room Gulick 206A. An information sheet is available for the exam. You will also want to refer to the review sheets for the first test and second test

Fifteenth Week: December 5, 7, and 9

On Monday, I will begin a discussion of exceptions and the try/catch/finally statement. The reading for this material is Section 9.3; this section is not in the printed version of the textbook, but you can read it on-line. In the remaining time, I plan to give an overview of some other aspects of Java.

There will be one final quiz, which you can expect on Wednesday.

Fourteenth Week: November 28 and 30; December 2

We will continue on the topic of arrays for the first part of the week, including multidimensional arrays. After that, we will be returning to Chapter 5 to cover some of the more advanced aspects of object-oriented programming, including one of the most central concepts, polymorphism.

The new reading for the week includes Sections 8.5 and 5.4.

Thirteenth Week: November 21

There is no class on Wednesday or Friday of this week, because of the Thanksgiving holiday. Happy Thanksgiving!

On Monday, we will continue with arrays, hopefully getting through most of Section 8.4.

Twelfth Week: November 14, 16,and 18

We will spend most of the week working on arrays, with just a few short diversions into other material that will be needed on the labs. The reading is Chapter 8, Sections 8.2, 8.3, and 8.4. This covers programming with arrays and dynamic arrays, including searching and sorting.

Because this week's lab turned out to be overly long, only Part 1 of the lab will be collected next Tuesday. At the Lab 12 next Tuesday, there will be just one or two short exercises about arrays, and then you can continue with the remaining parts of Lab 11.

Eleventh Week: November 7, 9, and 11

A handout about the final project, which is due on the last day of the term, is now available.

For the next few weeks -- partly to get you ready to work on a final project -- we will be jumping around in chapters 5, 6, 7, and 8. For this week, the suggested reading is Sections 5.5, 6.6, and 8.1. 5.5 covers "this" and "super", the special variables that have already been mentioned in class and shown up in some of the code that you have worked with. Section 6.6 is an introduction to components and layout. Section 8.1 begins the study of arrays, which we should get to by the end of the week.

Tenth Week: October 31; November 2 and 4

There is a test this Friday, November 4. A study guide is available. In addition, the second assignment is due on Wednesday.

We will be working on Chapter 6, Sections 1 to 4 this week. You will find that a lot of this material has already been covered, and that a few of the topics from these sections will not be mentioned in class at all. Some of the material from these sections will be on the test; you should check the study guide to see what you are responsible for. Next week, we will be continuing with additional material from Chapter 6, and then we will spend some time on Section 8.1, which covers the basics of arrays.

Ninth Week: October 24, 26, and 28

We will complete Section 5.2 on Monday. On Wednesday, we will cover Section 5.3. You should read both of these sections carefully. After that, I will talk briefly about one other topic in Chapter 5, creating a class by "extending" an existing class. Other than that, however, we will be skipping Sections 5.4 through 5.6 for the time being, and will spend some time on Chapter 6 and GUI programming. You can read Sections 6.1 and 6.2. You will find that most of 6.1 has already been covered in lab.

Remember that coming up next week, there is an assignment due on Wednesday (November 2) and a test on Friday (November 4).

Eighth Week: October 17, 19, and 21

The reading for the week is Sections 4.7, 5.1, and 5.2, although we will probably not quite finish 5.2 by the end of the week. With Chapter 5, we are starting object-oriented programming.

The second programming assignment will be handed out on Monday.

Seventh Week: October 12 and 14

There is no class on Monday and no lab on Tuesday, because of Fall break. The lab from last week will be due on Tuesday of next week, so you have no work due this week. However, there will be a quiz on Friday.

The reading for the week is Chapter 4, Sections 5 and 6. We might start Section 7 by Friday.

Sixth Week: October 3, 5, and 7

The reading for the week is Chapter 4, Sections 1 to 4. These sections cover using static subroutines and static variables. Section 1 discusses the more general topic of "black boxes" and expains how they relate to the design of complex systems. A subroutine is an example of a black box.

Don't forget that the first programming assignment is due on Friday.

Fifth Week: September 26, 28, and 30

There is a test this week, on Friday, September 30. An information sheet about the test is available.

The reading for the week is Section 3.7 (but this section is not covered on the test). On Monday, we still need to finish up some material from earlier sections.

The first programming assignment is due next Friday.

Fourth Week: September 19, 21, and 23

For this week, you should read Sections 3.3 to 3.6 in the book. These sections cover Java's control structures in more detail, with more information on if and while statements and three new control statements (do...while, for, and switch).

Remember that the first test of the term is coming up next week, on Friday, September 30.

Don't forget the picnic at 5:00 PM on Tuesday.

Third Week: September 12, 14, and 16

The reading for the week is Section 5 from Chapter 2 and Sections 3.1 and 3.2 from Chapter 3. We will be covering Section 3.1 on Monday, so that the material in that section will be available for the lab on Tuesday. Section 3.1 introduces two essential programming language features, "loops" and "branches." "Loops" allow a program to repeat a section of code over and over. "Branches" allow a program to select among two or more alternative courses of action. Later in the week, we will go back to Section 2.5, which covers the (somewhat tedious) details of expressions and assignment statements.

The annual Fall Picnic of the Department of Mathematics and Computer Science will take place on Tuesday, September 20, at 5:00 PM in the Science Mini-quad. Students who are considering a major or minor in computer science are invited -- and that should include everyone in this class.

Second Week: September 5,7, and 9

We will continue with Chapter 2 this week. The reading is Sections 2.2, 2.3, and 2.4. These sections cover the basics of using variables and built-in subroutines and doing basic input/output in Java.

First Week: August 29 and 31; September 2

Welcome to the course. If you read the course handout, you will see that there is already a quiz scheduled for next Monday, September 5. It will cover Chapter 1 and Section 2.1 of the textbook. It might also include material from the first lab, which takes place on August 30.

You should begin reading the textbook. A printed copy will be available in class on Wednesday, but you can start in any time with the on-line version at The first chapter of the book contains some background material about computers and an overview of programming in general and Java in particular. While you might not understand everything in this chapter at this time, it will be useful to have some overview of the field as you start the course. Chapter 2 is the beginning of the detailed study of Java programming that will occupy us for the rest of the course.

I will know my regular schedule of office hours by Wednesday. For the first two days of the term, August 29 and 30, I will be in my office at least from 1:00 to 3:00 PM.