605.201: Introduction to C++ Programming, Summer 1997

Paul McNamee


Course Overview
The chief objective of this course is to provide a classroom and laboratory environment that enables students to become proficient C++ programmers. Students are not assumed to have a background in computer programming and therefore introductory material on software engineering and program development will be presented. However, the majority of the course will be on the specifics of the C++ language. Topics include both the common heritage with the ANSI C language (e.g. syntax, primitive types, iteration, conditional expressions, functions, arrays, pointers and dynamic memory allocation, and the conventional standard libraries) as well as the object-oriented and unique aspects of programming with C++. These include classes and inheritance, polymorphism, overloaded and template functions, and possibly an introduction to the Standard Template Library (STL). The large amount of material precludes an in-depth treatment of object-oriented programming techniques in C++, which 605.404: Object-Oriented Programming with C++ would provide. Nonetheless, completion of this class will prepare the student for advanced topics in C++ whether in 605.404 or by professional study.
Schedule of Topics
June3 Introduction to C++, Syntax, Primative Types, Compiling and Debugging
June10 Conditional Expressions, Iteration
June17 Functions
June24 Arrays, Debugging Techniques
July1 Other Data Types, Some Standard Libraries
July8 Pointers and Memory Management
July15 Exam 1, More Dynamic Memory Allocation, Standard Libraries
July22 Object-Oriented Programming and Classes
July29 Constructors, Destructors, Member Functions, C++ I/O Streams
August5 Inheritance and Polymorphism, Template Classes
August12 Advanced Topics: Parsing Command Line Arguments, STL
August19 Exam 2
Grading Policy
Grades will be based on programming assignments (70%) and on two exams (30%). Students may use computers at home or work for the homework assignments, however more support will be available for students using the University's UNIX system. Homework assignments will be given out approximately weekly and should take between two and five hours to complete.
Academic Integrity
Work for this class is expected to be the result of individual effort. Unless explicitly prohibited, it is perfectly acceptable to make use of published examples and code in the literature with attribution. Furthermore, while it is permissible to discuss the general nature of lecture material and assignments with your peers, this does not extend to revealing solutions or source code. Students are expected to uphold the academic integrity of the university. Students using without reference, published material or copying the work of another individual will receive an `F' on the assignment and the matter will be referred to the dean. Contact me if you have any questions about this policy or questions about a particular assignment.


  1. Homework 0, hw0.ps. A sample exercise, not for a grade. Important: apply for a university account right away.
  2. Homework 1, hw1.ps.
  3. Homework 2, hw2.ps.
  4. Homework 3, hw3.ps.
  5. Homework 4, hw4.ps.
  6. Homework 5, hw5.ps.
  7. Homework 6, hw6.ps.
  8. Homework 7, hw7.ps.
  9. Homework 8, hw8.ps. Note this homework isn't required. You can turn it in, or not, in which case just the first 7 assignments will be averaged.


  1. The Course Outline, course-outline.ps.
  2. Introduction, lecture1.ps.
  3. Lecture 2: Conditional Expressions and Iteration, lecture2.ps.
  4. Lecture 3: Functions, lecture3.ps.
  5. Lecture 4: Arrays and Structures, lecture4.ps.
  6. Lecture 5: Pointers and Memory Management, lecture5.ps.
  7. Lecture 6: Pointers Continued, lecture6.ps.
  8. Source code for linked list of ints, list.C .
  9. Source code for Binary Tree of colors, Colortree.C .
  10. Lecture 7: Miscellaneous Topics, lecture7.ps.
  11. Lecture 8: Object-Oriented Programming, lecture8.ps.
  12. Location.h, Location.C, and Places.C source code for Location class.
  13. Lecture 9: Classes Part II and File Input and Output, lecture9.ps.
  14. The source code for the String class is in the 201/code/ subdirectory. The relevant files are: String.h, String.C, TestString.C, and TestString.output.
  15. Lecture 10: Inheritance and Polymorphism, lecture10.ps.
  16. Handouts from Cay Horstmann's book, Mastering C++, were given out in lecture. Contact me if you need these.
  17. Source code for the Mammal example using virtual functions is available here.
  18. Lecture 11: Advanced and Miscellaneous Topics, lecture11.ps.
  19. Source code for the PrintMain example of command line arguments and the TemplateClass and BinarySearch programs is available.

On-line C++ resources

JHU on-line resources

Paul McNamee