Cay Horstmann & Timothy Budd
These are the original instructions, as supplied by the authors. If you are reading this text, then your course instructor has not modified these instructions for use at your institution. In particular, electronic submission of the lab forms will not be possible. Check with your course instructor how you should submit your work!
These labs are companions to the book "Big C++". These exercises are designed to be carried out in a computing laboratory, or in home study, with a C++ compiler to test programs and either a web browser to view the assignments, or simply a printout of the web pages.
Each lab has a few review exercises (marked R) and programming exercises (marked P). Instructors should feel free to select a subset of the exercises to match the lab schedule. Some of the review questions can be answered with or without a computer; some require the students to write simple test programs.
All of the lab exercises assume either access to an ANSI standard compiler or the CCC libraries that implement the necessary ANSI C++ features for pre-ANSI compilers. Some exercises use the CCC graphics library.
1 - Introduction
Chapter 2 - Fundamental Data Types
Chapter 3 - Objects
Chapter 4 - Basic Control Flow
Chapter 5 - Functions
Chapter 6 - Classes
Chapter 7 - Advanced Flow Control
Chapter 8 - Testing and Debugging
Chapter 9 - Vectors and Arrays
Chapter 10 - Pointers
Chapter 11 - Inheritance
Chapter 12 - Streams
Chapter 13 - Object-Oriented Design
Chapter 14 - Recursion
Chapter 15 - Sorting and Searching
Chapter 16 - Introduction to Data Structures
Chapter 17 - Operator Overloading
Chapter 18 - Memory Management
Chapter 19 - Exception Handling
Chapter 20 - Name Scope Management
Chapter 21 - Polymorphism
Chapter 22 - Templates
Chapter 23 - STL - Containers
Chapter 24 - STL - Iterators and Algorithms
Chapter 25 - Unified Modelling Language
Chapter 26 - Introduction to Design Patterns
Chapter 27 - Graphical User Interfaces
Chapter 28 - Relational Databases (no lab)
Chapter 29 - XML (no lab)
You need to ask your course instructor how to submit your lab work. Here are the most popular options:
Simply print out each lab (with the "Print" command of your browser), then fill in your answers with pencil and paper. However, don't write programs into the supplied boxes. That is, ignore the instructions /* paste program here */. Instead, print the programs out separately, clearly label them and attach the printouts. Submit your work in the usual way.
Simply print out each lab (with the "Print" command of your browser), then fill in your answers with pencil and paper. However, don't write programs into the supplied boxes. That is, ignore the instructions /* paste program here */. Simply save them to a floppy disk and attach it to the lab form.
Fill in the answers to the questions in the browser, but skip those questions that ask you to paste your code into the form windows. However, don't type programs into the supplied boxes. That is, ignore the instructions /* paste program here */. When you are done, click the "Send to" button. Email your programs to your instructor separately.
Fill in the answers to the questions in the browser, and use "copy and paste" to paste your work whenever you are instructed to /* paste program here */. When you are done, click the "Send to" button.
It is best not to use the browser for web browsing while you work on your lab. If you move away from your form, it is easy to lose the work that you have already completed. If you do move away from the form (for example, to read these instructions), always use the "Back" button to get back to your lab. Never use the "Reload" button or another link to the lab page--that reloads a new form that has all entries blank, and your work is lost.
Decide whether you are interested in electronic submission of lab work.
Electronic submission has several advantages: It reduces printing costs in the labs. You don't have to read the students' handwriting. If you are ambitious, you can write scripts to automate some of the grading.
Of course there are disadvantages. Students with less computer experience may find it difficult to switch between the browser and the compiler. You, or a lab administrator, needs to put a "CGI script" on the web server and modify each of the lab HTML files to work with that script. This is not difficult but it requires familiarity with HTML and CGI scripting. Furthermore, there may be an increased risk of cheating.
If you are at all unsure, it is probably wise to err on the side of caution and use paper submission. Or you can give your students the choice. That way, you won't have to spend time supporting students with less computer experience.
You should then modify this file. Remove this section and the next. Remove all options from the preceding section that you don't want your students to use. Remove the note at the beginning of the file. If you do opt for electronic submission, the lab HTML files need to be modifed as well. That process is described in the next section.
Please note: This procedure is unsupported by the author and the publisher. If you do not have the expertise to carry out the following steps and perform your own testing and debugging, then neither the author nor the publisher will be able to assist you. Do not attempt these steps unless you are well grounded in HTML and CGI scripts.
You need to place a CGI script on your web server that can handle the form submission. The simplest handling is to email the form content to the instructor or grader. For this purpose, you would use an email script. You need to put the script onto your web server. Of course, if you are ambitious, you can do more processing on the student data than just emailing them, by writing your own CGI script.
Please note: You must use your own server. The Mathematics and Computer Science department at San Jose State University cannot host your traffic, and you have no permission to use their server except for testing purposes. The mcsmail script is supplied as an example only and is unsupported by the author and the publisher.
Next, you need to edit each of the lab HTML files.
Each lab HTML file contains the following HTML code near the beginning of the file. You need to change the bold portions.
<FORM ACTION="http://www.mathcs.sjsu.edu/cgi-bin/mcsmail" METHOD="POST">
<TD>Your name: </TD>
<TD><INPUT TYPE="text" SIZE="20" NAME="username"></TD>
<TD>Your email address: </TD>
<TD><INPUT TYPE="text" SIZE="20" NAME="recipientaddr"></TD>
<TD>Your student ID number: </TD>
<TD><INPUT TYPE="text" SIZE="20" NAME="ID"></TD>
</TABLE><INPUT TYPE="HIDDEN" NAME="useraddr" VALUE="firstname.lastname@example.org"><INPUT TYPE="HIDDEN" NAME="recipientname" VALUE="yourself since this form has not been customized for your
<INPUT TYPE="HIDDEN" NAME="subject" VALUE="CCC Lab1">
<P><A NAME="#submit"></A>Once this form has
been customized for your institution, you can use this button <INPUT TYPE="submit" VALUE="Send lab">
to send your lab work. Be sure to read the <A HREF="instructions.html">instructions</A>
before starting your work.</P>
Do the following: