CS177 C++ Programming

Fall, 1996

Instructor

Roger Hartley, SH 148, telephone 646-1218

Office Hours: Mondays, 1:00 - 3:00 pm; Thursdays, 11:00 am - 1:00 pm.

Where and when

Room: SH113

Time: MWF 8:30 - 9:20

For the first four or five weeks, the Friday session will be spent in the lab. SH118.

Textbook:

Thinking in C++, by Bruce Eckel, Osborne McGraw Hill, 1995.

The definitive guide to C++ is The C++ Programming Language (2nd. edition), by Bjarne Stroustrup, who designed the language. While not essential for this course, this book is essential if you are going to use C++ for applications programming later.

Course outline

C++ is a computer language that attempts to do two incompatible things. The first is to be an efficient implementation of the ideas in object-oriented programming. The second is to encompass, and be

sympathetic to, the ideas in the strongly-established language C.

The fact that it succeeds at all is strongly in favor of the tenacity of its designer, Bjorne Stroustrup. Its failures are largely due to the idiosyncracies of C, and not due to poor implementation. It is the best and most-widely used object oriented language available today.

I will teach C++ as the first accessible object-oriented language implementation. Since the textbook, and the course, delves deeply into the language, it would be excellent to have a knowledge of C already,

or at least an imperative language like Pascal, Ada, Fortan or Basic, although it is not essential to succeed in the course. C++ is actually not "the next C"; it is a different language.

So, we will study the principles of object-oriented programming and how C++ allows implementation of these ideas. The fundamental notions here are abstract data typing through encapsulation and data-hiding,

message-passing, polymorphism and inheritance.

Syllabus

The course is organized into six sections, each of which will address a topic from programming methodology. The content of each topic will use C++, but the principles are applicable to any programming language. In this way, you will gain a good set of programming skills, as well as a thorough knowledge of C++. The six topics are:

  1. Code reading - from small fragments to whole functions.
  2. Code simulation - by hand, with paper and pencil.
  3. Program design - top-down stepwise refinement - classes and object-oriented design
  4. Program testing - test sets, limits, unexpected inputs.
  5. Program debugging - assertions, using watches as a substitute for hand simulation, extra debugging code.
  6. Program modification - adding requirements, changing requirements, improving efficiency, improving coding.

The breakdown by weeks is:

Calendar

	   August 1996
	 S  M Tu  W Th  F  S
      	       1  2  3
	 4  5  6  7  8  9 10
	11 12 13 14 15 16 17
[1]	18 19 20 21 22 23 24	Classes start: 21st
[2]	25 26 27 28 29 30 31	Deadline for add: 30th
	   September 1996
	 S  M Tu  W Th  F  S
[3]	 1  2  3  4  5  6  7	Labor day: 2nd
[4]	 8  9 10 11 12 13 14
[5]	15 16 17 18 19 20 21
[6]	22 23 24 25 26 27 28
[7]	29 30
	   October 1996
	 S  M Tu  W Th  F  S
	       1  2  3  4  5
[8]	 6  7  8  9 10 11 12	First exam: 11th
[9]	13 14 15 16 17 18 19	Last drop day: 16th
[10]	20 21 22 23 24 25 26
[11]	27 28 29 30 31
	   November 1996
	 S  M Tu  W Th  F  S
	                1  2
[12]	 3  4  5  6  7  8  9
[13]	10 11 12 13 14 15 16	Moratorium: 15th
[14]	17 18 19 20 21 22 23	
[15]	24 25 26 27 28 29 30	Thanksgiving: 27th - 29th
	   December 1996
	 S  M Tu  W Th  F  S
[16] 	 1  2  3  4  5  6  7	Last day of classes: 6th
[17]	 8  9 10 11 12 13 14	Exam week: 9th - 13th; Final: Fri, 8-10AM
	15 16 17 18 19 20 21   
	22 23 24 25 26 27 28
	29 30 31

Resources

The programming problems can be completed in two ways. Either an account on our computer science SUN network will give you access to UNIX and the C++ compiler g++, or you will need access to a PC running Microsoft Visual C++ or Borland Turbo C++ at home or in the Jacobs lab. I can read 3.5" high density floppy disks.

Assessment

There will be one mid-term test and a final comprehensive examination. There will also be three or four lab. exercises early on in the course, and then four or five programming problems starting out easily and graduating to fairly hard at the end of the course. It may also be necessary to give take-home quizzes for certain parts of the course. The assignment of credit is as follows:

My grading is always flexible, but justice will also be done! ! The penalty for late work is that it receives a maximum C grade, but there will be two cut-off dates. A moratorium date is included in the calendar after which, any work that is due but not handed in will receive a zero. The first day of exam week is the last day for handing in work for credit.