This page is for the COM 1101 section of Sergey Bratus

Class meets Tue, Wed, Fri 11:45 a.m. - 1:20 p.m. in 101 CH

Recitations for this class are given on Thursdays 12:00 - 1:00 p.m. in 245 CN.

The office hours for this class are
Sergey Bratus Tue, Wed 2:00 - 3:30 p.m. and by appointment.
Mani Sundaram Tue, Wed 4:00 - 5:00 p.m., Thu 2:00 - 5:00 p.m.

My office is 19 CN, ph. 373-5119. E-mail me at to set the time.

The teaching assistant for this course is Mani Sundaram, office 15 CN, 373-3824. His e-mail is .

The grader for this course is Akochi Agunwamba. His e-mail address is Please do not e-mail him for hints or help on the labs, write or talk to Sergey or Mani instead. Akochi will answer your questions on the status of your homework.

Prepare for the final exam by looking at the midterm solutions and the sample final exam.

Here is the short sylabus for this class. The detailed sylabus will be in the class packet, available at the bookstore.

It is time to choose your Course Project. For those of you who decide to do an arcade game, here is the demo code for controlling objects in the graphics window. In the first example the mouse pointer is used to control a mote on the screen, the other two deal with keyboard arrows (and other keys). For the latter you need to an extended version of the emulator, on a PC, or the file "ct_kbd.h" found in the Project Demos:Keyboard I and Project Demos:Keyboard II folders on the Mac. See changes.txt for the description of the function int KeyDown() that polls the keyboard and returns the code of the key currently held down. See the following demos for usage.

Look at the solutions of the previous midterm. It was built around the problem that I started talking about on Friday during the review lecture. The midterm was followed by this extra assignment in word counting, with this pre-processed text fragment for testing.

You can have a look at the class materials from the previous time I taught this course.

Here is the code for pointer exercises.

Here are the lecture notes for the lecture on structs and the first lab.

Here is the code for the Rectangles Lab. Find the complete docs on Ambassador, in the course folder. The solutions: Part I and Part II.

Read the description of Lab 2.

Read the description of Lab 3. Here are extra hints on implementing collisions between objects.
See the solution with explanations. Please have a look at the section on const correctness.

Read the description of Lab 4.

Midterm Programming Part is due on Tuesday May 11.

Read and run the "PiggyBank" exercises. Try to predict the results to see if you understand when various constructors and the destructor are called.

Here are the Lecture notes on Stacks, and the code for the labyrinth runner:

Notice the use of processor directives #ifndef ... #endif in the header files. Read about these and other fundamental way of managing a multi-file program here. Also, see the C++ tips under Local Links below.

It is important that you understand how this example works. The entire program is available in folder "ariadne" in the class directory on Ambassador.

This example of template lists was discussed in class.

Here are the lecture notes on Operator Overloading, with the Fractions example.

Here is the Midterm solution.

Here is Lab 5 on sorting arrays, the final lab for this course.

Look at the code for a self-expanding table class of records (name, value). Then look at the self-expanding template table class. The so-called vector class of the Standard Template Library, described in Budd's text, is based on similar ideas.

Finally, this the implemetation of QuickSort, with the text reference. Lecture notes on Binary Search and QuickSort will be posted shotly.

If you would like to work on a PC and are feeling adventurous, have a look at my emulator of some basic CoreTools functionality. I tried it with Visual C++ 5.0 and 6.0, as well as with Borland C++ 5.0. It was reported that my project files caused crashes. Therefore you need to create your own projects. Basically you need to
  1. Create a new empty Win32 Console Application project.
  2. Add my files manually to it.

A more detailed detailed description is given in the HOWTOs below.

A preliminary version of the CT emulator Manual list is available, thanks to Alexander Chervinsky. A more detailed version is in the works. In the meantime read and run this main_test.cpp, which is a haphazard medley of various undocumented tests. Source files:
MS Visual C++ Borland C++
HOWTO vc6-howto.txt bc-howto.txt
CT_EMU files
CT_EMU with
keyboard support  

Here is the zip archive of the Rectangles lab source code (VC++) and executable.

Here is the zip archive for Lab 2 (VC++).

Note: This is not an official release of CoreTools for PC, and you should not count on much support.

You can (and should, when in doubt about the syntax of some CoreTools function) look at the original Macintosh CoreTools sources (authored by Prof. Rasala, Prof. Proulx and Prof. Fell). The source is the best documentation, or, as Obi-van Kenobi used to say, "Use the Source, Luke!".

The syllabus and the class schedule are available on Ambassador (the CCS Systems Mac file server), in the Course Directories:COM 1101:Students:Bratus folder.

The texts for this course are

You are expected to read a lot of these texts on your own. Lippman and Lajoie's book is also intended to serve as a reference in C++ for you.

Beyond the textbooks:

Useful Links:

Personal: Local: General C++ Info: STL: Tell me if you find good on-line C++ or C references!