By: Higher Education
Abstract: 15-127: Introduction to Programming and Computer Science
Syllabus for 15-127
Introduction to Programming and Computer
Spring 1997: Sections C-F
Introduction to problem solving and programming in
C++. The course is taught with an emphasis on programming methodology
and style: problem analysis, program structure, algorithm analysis,
data abstractions, and dynamic data. Credit is by mastery examination.
My goal in 15-127 is for students to learn the general
principles of programming: how to specify, design, code, document,
test, debug, evaluate, and maintain computer programs. To make
these principles concrete, we will explore them by studying and
using the C++ programming language. The content of 15-127 can
be neatly divided into three main subject areas: Algorithmics,
Abstraction, and Analysis (the triple-As):
This course emphasizes Object Oriented Programming
(OOP). The foundational unit of Object Oriented Programming is
the class: a syntactic structure that describes and encapsulates
the behavior (control structures) and state (data structures)
of objects. We can view programs as collections of interacting
objects. Early in the semester we will learn how to read the public
interfaces of classes, and construct and use such objects in our
programs; later, we will learn how to augment old classes and
write new classes, and finally how to derive subclasses via inheritance.
Classes provide an excellent context for exploring many aspects
The main programming methodology that we will learn
and employ is iterative-enhancement, which decomposes a large
project into a series of increasingly complex mini-projects (each
is called a phase). Starting from a kernel, and writing a program
for each of these phases in sequence, results in a solution to
the original project. Each phase requires repeatedly specifying,
designing, coding, documenting, testing, debugging, and evaluating
the [mini]project; each phase produces a testable program that
is a small extension of the capabilities of the previous phase.
We will apply this same methodology when building software components
Although we will mostly study programming-in-the-small,
we will concentrate on the technical and lingual issues of building
large reliable programmed systems, which are constructed from
components. I expect to cover the relevant C++ language features
thoroughly (see Algorithmics and Abstraction), but we will also
spend much time discussing the less concrete but ultimately more
general and important aspects of programming (see Analysis). In
particular, we will study and use tools for debugging, browsing,
and profiling programs.
Finally, to become an expert in any discipline, we
must master its terminology. Fluency with technical terms allows
us to communicate and even to think more accurately and concisely.
Therefore, the materials in this course will define, illustrate,
and repeatedly use many important technical terms concerning programming.
Take the time required to master them.
I will assign a Course Assistant (CA: typically an
upper-class CS major) to help with each of my sections. Each CA
will be present during class, and collectively they will consult
at various times in the Computer Lab (see Computer
Labs) along with the CAs for a dozen other
15-127 sections. During their consulting hours, expect CAs to
help you diagnose problems and guide you toward solutions. They
are in the labs to help you learn how to program by answering
your questions, but, do not expect them to write your programs
for you. I will announce our CAs and their specific consulting
hours during the second week of class.
I welcome students, individually or in small groups,
to come by and talk with me during my posted office hours, or
whenever I happen to be in my office. If you need to talk to me
but cannot come by during my office hours, please call me so that
we can arrange an alternative time to meet; or, maybe we even
can resolve the entire issue over the telephone. Also, see Electronic
Mail for an excellent way to ask short questions.
I will be glad to talk with you about 15-127, Computer
Science, CMU, or whatever else you want to discuss. I especially
encourage students who are having problems in the course to visit
me immediately. The primary reason that students fail to thrive
in 15-127 is that they fall behind in their work often because
of what is initially a small misunderstanding; but, because of
the cumulative nature of this course, even small misunderstandings
can quickly grow into big ones. Getting help fast can critically
affect your overall performance in 15-127: many times I've seen
students start performing one grade level higher after getting
help during my office hours.
Electronic Mail (E-Mail)
If you have a small question (one requiring little
back-and-forth discussion), and cannot directly contact me or
any of the CAs, please ask it by sending me e-mail. It has been
my experience that the very act of writing a detailed description
of a problem (detailed enough so that someone not physically present
can understand it) often leads students to a solution for their
problem. Frequently, before I even get to read my e-mail, I receive
a second message saying, "Please ignore my earlier message,
I solved the problem myself." The seeds of the solution are
often sown in the act of carefully composing the first e-mail
When I am not in class teaching, I typically read
and answer e-mail every few hours during the day. I normally will
not answer e-mail sent to me after about 11:00pm until early the
next morning. If you have problems late at night problems that
the CAs cannot help you resolve please send me e-mail summarizing
your problems and then go to work on something else.
Computing Platforms and Programming Environments
The computing platform for this course is Intel-based
(Pentium) PCs running the Windows NT Operating System (OS): Windows
NT is a more rugged version of Windows 95, but with the same Graphical
User Interface (GUI). The programming environment that we will
use is the Borland C++ Integrated Development Environment (IDE:
including an editor, compiler, linker, debugger, class browser,
profiler, help facility, etc).
The required computing platforms and programming
environments are available in the Introductory Computer Labs (ICLs),
Wean Hall 5419 A/B. These rooms are used as classrooms during
the day, and then are open for general use in the late afternoon,
evening, and on weekends. In the past, the hours for the ICLs
have been M-Th 4:30pm-12:30am; F 4:30pm-10:30pm; Sa 10:00am-10:00pm;
Su 10:00am-12:00am. The exact schedule for this semester will
be posted soon on the doors outside these rooms.
The same computing platforms and programming environments
should also be available at all other CMU clusters running Windows
NT: WeH 5217, Cyert 100, and Baker 104F. Although these labs have
the advantage of being open 24 hours/day, only WeH 5419 is staffed
by 15-127 CAs, so the ICLs are still the best place to work if
you expect that you will need help.
Finally, students with the appropriate hardware and
OS (Windows NT or Windows 95) can also purchase copies of Borland
C++ 5.0 in CMU's Computer Store (628-2636), for their personal
use. The cost is $115. To complete their coursework, such students
will need to learn how to interface to a special file server for
the introductory group, typically to download/upload files.
The textbook for this course is, Deitel and Deitel,
C++: How to Program, Prentice-Hall. Although most of the
readings will come from course notes that I will distribute on-line,
this book provides a good introduction to programming in general;
it is also a good reference to the C++ language (which is used
in many CS courses, research projects, and in industry).
Purchase one package of ten High-Density diskettes.
Bring at least one blank diskette (or one with plenty of space)
to each class. You will use these diskettes for archiving your
On most days, the 50 minute class will comprise 30-35
minutes of lecture/discussion followed by a 15-20 minute (ungraded)
mini-lab. The mini-lab will focus on that day's lecture material:
it will allow you a hands-on experience to learn the material,
or just explore it further. During these mini-labs, the CA and
I will circulate around the class to answer questions. On most
Mondays, I will give a quiz instead of a mini-lab (see Quizzes).
On some Mondays I will give a Midterm for the entire 50 minute
class (see Midterms).
I hope to conduct my lectures in an open manner:
not just broadcasting information but discussing and explaining
it. Our setting a small computer lab was designed to facilitate
exactly this kind of classroom interaction. So, I encourage you
to participate by raising your hand. If you have a question about
the material, it typically means that I have explained something
poorly or incompletely, and that other students have (or will
soon have maybe right after they leave the classroom) the same
question. So, it would be best for all of us to correct the problem
immediately in class by someone bringing it to my attention. In
this regard, our class motto concerning questions is, The only
stupid question is the one left unasked.
I will produce a detailed set of lecture notes (in
PowerPoint). I will distribute all these notes on-line, a day
or two before each lecture. This approach will free you from taking
extensive notes in class, although you may want to copy my notes
and annotate them (physically or electronically) with information
that you glean in class. Please read these notes before class,
so that you will be better prepared to discuss the material I
present, and ask questions about it.
Legend: = reading = mini-lab = test (quiz
or midterm) program assigned program due
Exploring Files/Projects/C++ IDE
#1: NT OS & BC++ IDE
EBNF handout, debugger.doc
expression I.ppt, profiler.doc
#2: BC++: Debugger & Profiler
#3: Suite of Simple Programs
Writing Programs using Libraries
#4: Suite of Programs Using Classes
Exploring switch, loops, exceptions
Writing a Kernel with Stubs
#5: A Large Program
Writing a Kernel for Program #5
#6: A Program with Functions
Writing Class Member Functions
#7: Writing a Class & Its Driver
Array Construction & Mutation
Exploring Arrays of structs/objects
#8: A Program with Arrays
Exploring the vector/string Classes
#9 C/D Mastery Practice
Modifying the Stack ADT
#10 A Program using ADTs
Modifying the Queue ADT
linked list I.ppt
#11 Suite of Linked List Functions
linked list II.ppt
linked list III.ppt
List Construction & Mutation
#12 An ADT with Linked Lists
Reimplementing the Queue ADT
Recursive Functions for Integers
Recursive Functions for LL
#13 B Mastery Practice
C&D Mastery Problems
B Mastery Problems
A Mastery Problems
Quotes (to get us started thinking about programming)
Computer Science is the first engineering discipline in which
the complexity of the objects created is limited solely by the
skill of the creator, and not by the strength of raw materials.
A programming language is a system of notation for describing
computations. A useful programming language must therefore be
suited for both description (i.e., for human writers and
readers of programs) and for computation (i.e., for efficient
implementation on computers). But human beings and computers are
so different that it is difficult to find notational devices that
are well suited to the capabilities of both.
R. Tennant (Principles of Programming Languages, Prentice Hall,
Habitability is the characteristic of source code that enables
programmers coming to the code later in its life to understand
its construction and intentions and to change it comfortably and
confidently...Software needs to be habitable because it always
has to change...Programs are written and maintained, bugs are
fixed, features are added, performance is tuned, and a whole variety
of changes are made both by the original and new programming team
members... What is important is that it be easy for programmers
to come up to speed with the code, to be able to navigate through
it effectively, to be able to understand what changes to make,
and to be able to make them safely and correctly.
R Gabriel (Patterns of Software, Oxford Press 1996)
It goes against the grain of modern education to teach students
to program. What fun is there to making plans, acquiring discipline,
organizing thoughts, devoting attention to detail, and learning
to be self critical.
I will give nine quizzes, to ensure that everyone
is following the material and is able to express themselves in
both English and C++. All quizzes are given on Mondays, replacing
a mini-lab (so, each quiz is 15 minutes). Quizzes are cumulative,
but emphasize the material discussed in the previous week. I will
distribute a solution at 2:30 on the day that each quiz is given.
For this reason, there are no make-ups for quizzes; but,
I will drop your lowest quiz score.
I will give three midterms. Midterms are cumulative,
but emphasize the material covered in the previous four weeks.
In format, each midterm will be like a long quiz, taking the
entire 50 minute class period. Midterms are a bit more philosophical
than quizzes: besides testing C++ skills, they will test a broader
view of programming. I will distribute a solution at 2:30 on the
day that each midterm is given. For this reason, there are no
make-ups for midterms; unlike quizzes, all midterms count.
I will give thirteen programs. Generally, each will
be assigned on a Wednesday and be due the following Wednesday.
Some programming assignments may be longer, lasting up to 2 weeks.
Also, some programming assignments will come directly from the
Mastery Exam (see below), so that you will have a chance to preview
the kinds of problems that it encompasses. I will distribute a
solution at 2:30 on the day that each program is due (except for
solutions to Mastery Exam problems, which I cannot distribute).
The best time to study my solution is then, having just spent
a week working on yours. For this reason, I will not accept
any late programs. Partially working programs will receive
partial credit: Half a program fully working is worth more
than a full program not working. Finally, I will drop your
lowest program score.
Later in the semester I will distribute a more detailed
document on program submission and grading. For example, programs
are graded both for correctness and style. The first few programs
will be graded for both, but only the correctness grade will be
entered. Once you become familiar with the grading criteria for
style, both grades will count.
The following table illustrates how quiz, midterm,
and program grades are combined into a coursework grade (see also
Mastery Exam Grade,
and Final Grade
Your coursework grade is computed according to the percentage
of points that you accumulate during the semester A: 90-100%,
B: 80-89%, C: 70-79%, D: 60-69%, and R
(Fail): below 60%
I will maintain a spreadsheet with all up-to-date grades on-line.
It will be publicly available, indexed by your student IDs. I
expect you to examine this spreadsheet weekly. If I have incorrectly
recorded any of your grades, see me as soon as possible, bringing
your graded work with you to help resolve the discrepancy.
Mastery Exams provide a controlled environment in which you can
demonstrate the problem solving and programming skills that you
have acquired during this course. Each mastery exam is given during
the exam period at the end of the semester, in our classroom,
in one 4-hour sitting. A mastery exam requires you to write solutions
to a random group of programming problems at different levels.
Mastery Exams are given at the D, C, B, and A level. Besides file
I/O, the material covered at each level is
All mastery exam problems there are about a dozen at each level
are publicly available on-line. In fact, during the quarter we
will solve some mastery problems as programming assignments. At
the end of the quarter, we will also spend a few days reviewing
the entire suite of mastery problems.
Mastery Exam Grades
All students are required to take a mastery exam to pass 15-127.
First you must decide at what level you are taking the exam (see
the matrix below). Then, when you arrive for the exam, you will
be randomly assigned programming problems from the D level up
to (and including) the level that you chose. If you correctly
solve all these problems, your mastery exam grade will be the
level that you chose. If you fail to solve any problem, your mastery
exam grade will be the level before the first problem that you
failed to solve (starting at the D level, working upward). So,
if you attempt the B level mastery exam and pass problems at the
D and B level, but fail the problem at the C level, your grade
is D. If you fail at the D level, or if you do not show up for
your assigned mastery exam, you fail the entire mastery exam,
resulting in a final grade of R.
Your final grade is based on a combination of your coursework
grade and your mastery exam grade. Final grades are computed according
to the following matrix. Note some interesting properties of this
matrix: an A in your coursework and a B on your Mastery yields
a Final grade of A; also, a B in your coursework and an A on your
Mastery yields a Final grade of A.
Final Grades with Mastery Retake
Students are allowed to retake the mastery exam once, if they
perform very poorly on it: their mastery exam grade is two letters
lower than their coursework grade. In this case, a student can
retake the mastery exam and the final grade is computed according
to the following matrix. Note that in this case, the final grade
can equal, but not exceed the coursework grade.
There are two ways to retake the mastery exam:
Generally retakes are not allowed after the retake period of the
Exceptions to the Rules
This document sets forth many strict policies that apply, by default,
to all the students in this course. But, in the case of extraordinary
circumstances, I reserve the right to bend these rules for individuals.
If you feel you that are the victim of such circumstances, I encourage
you to contact me, to discuss how I could bend the rules in your
Total Available Lectures: 43 Days - 3 Midterm Exams = 40
Attending lectures is important, but you will not truly understand
the material until you have used it in your programming assignments.
Always be open to identifying a misconception or learning something
new. From this struggle and introspection comes real knowledge
about (and mastery of) programming.
Missing in Action: Frameworks/OOP Construction
10:30 Adam Megacz email@example.com
11:30 Bryan Meyer firstname.lastname@example.org
Monday: Contact Preparation
Office Hours Lecture
(by appointment) Mini-Lab
Office Hours Lecture
(by appointment) Mini-Lab
Library (all of .h, .cpp, .lib)
Quizzes, Midterms, Test
Programming Assignments & Solutions
Standard IDE with additional speedbar entries
Grading Spread Sheet
Retrieve, Edit, Submit Questionnaire
Retrieve Project, Run/Fix Program, Submit Project
Retrieve Project, Debug Program, Submit Writeup
Retrieve Project, Profile Program, Submit Writeup
Code Style Sheet
Handout <->Lecture: .doc or .ppt for things
like using the debugger, profiler
Free 30-day trial! Develop for Windows, Mac, Android, iOS, devices and gadgets!
More social media choices:
C++Builder on Google+
@RADtools on Twitter
Server Response from: ETNASC02