Professional Documents
Culture Documents
Mary P. Boelk
Johnson Controls Inc.
J. Glenn Brookshear
Marquette University
Preface
This manual consists of a series of laboratory experiments to accompany the text
Computer Science: An Overview, Fifth Edition, by J. Glenn Brookshear. These experiments,
written in the spirit of learning by doing, are designed to give students a working
knowledge of the (ANSI) C++ programming language.
The manual is divided into eighteen sessions, each of which is designed for a two-
hour laboratory session accompanied by an instructor. Twelve of the sessions cover the
central core of the C++ language, and the other six cover special topics that may be
included at the instructor's discretion. Each session closes with a selection of problems
that can be assigned as desired to give students additional experience outside of the
closed laboratory environment.
The first laboratory session covers the particulars of the programming environment
that will be used in the following laboratory sessions. It is meant to be supplemented by
the local institution with materials that explain site-specific details. These materials
should cover topics such as system entry, the file system, and commands related to
editing, compiling, and running C++ programs.
unit is used. Following this is either the letter E or P, which indicates whether the unit is
associated with an experiment or a post-laboratory problem. The identifier closes with
two digits indicating the particular experiment or problem. In those cases in which more
than one software unit is associated with a single experiment or problem, the identifier
has an additional letter indicating whether the software is the first, second, etc., unit
associated with that experiment or problem. Thus, the software identified as CP03E02A is
the first software unit needed for Experiment 2 in Laboratory Session 3. We have
included these identifiers throughout the manual so that students can use them as a
means of accessing the software within the laboratory environment.
We would like to thank Marian Manyo from Marquette University for her comments
and suggestions.
M.P.B.
J.G.B.
Contents
Session 6* Functions 77
A Simple C++ Function 78
Passing Parameters 82
The return Statement 85
Post-Laboratory Problems 91
vi Contents