CISC 181 Sections 10-12 Lab Notes
Common Lab Mistakes
-
About script files: When creating your script file, any backspaces are
recorded as well. This leads to a very confusing printout of you script
file. Sometimes, the character ^H appears on your printout, sometimes [K,
and sometimes the printer goes back and prints over top of the same spot
twice. In the future, re-create the script file if you have used the backspace
key while creating the file.
-
About the header at the top of your program: I will be understanding when
you print your script file and forget to include the section number. You
may write that in by hand if it is something so trivial. However, I will
not give full credit to assignments with the entire header hand-written.
(From a software development or real-world point of view, if you do not
include your name in the file, your work may not be credited to you.)
-
About handing in a cover: In the future, do not hand in your labs with
the cover sheet that comes out of the printer. (The blue sheet that contains
only your UNIX account information and the date
-
Whenever you use the character '>' or '>!' in a command, you are telling
UNIX to take the output of the program and save it to the file specified
after that character (it removes whitespace from both sides of the filename,
by the way). This syntax is specific to the shell you are using. Using
">!" did not work for some students using bash, so use '>' instead if you
use bash.
Lab Manual Errata
Lab 1
-
Due to time constraints, we are not requiring you to type in the file lab1.cc
in a text editor. You are allowed to copy the file from the course directory
using the command on pafe 27 (cp /www/htdocs/CIS/181/Labs/text.data)
-
The file text.data is supposed to be used in the lab, but the manual does
not say where to get it. It may be copied from the same directory as lab1.cc,
so the command will be "cp /www/htdocs/CIS/181/Labs/text.data ."
-
The manual says to email the TA at the end of the lab but does not
say how to do so. There are two ways recommended: look up the manual on
the program mailx (type "man mailx") or use the program called pine by
typing "pine". Pine is much simpler to use as a complete mail solution.
mailx is for sending email straight from the command line.
Lab 2
-
In the file lab2a.cc, do not be concerned that only your first name is
displayed when entering both first and last names. This is how cin <<
works and is meant as a demonstration. To get the full name, you would
use cin.getline(name, 29) but that is not part of the assignment.
-
Page 41: the path for lab2b.cc is incorrect. It should be /www/htdocs/CIS/181/Labs/lab2b.cc
-
In the lab, the flag ios::showpoint does not behave as you might expect.
To correct the lab to format currency correctly, replace all occurrances
of ios::showpoint with ios::fixed.
-
Page 43, change #2: the manual is ambiguous as to the instructions. All
that is required is that you change the price of apples and pumpkins in
the source code to something else. However, those students that prompted
the user for the prices will be given full credit.
-
Page 44, last line: should read lab2b.cc, rather than lab2a.cc
-
Page numbers for sections of the book are mentioned, but they are incorrect
for the current edition of the book.
-
Do NOT do the homework in the lab manual for lab 2
Lab 3
-
Page 56: the manual is incorrect about the contents of lab2b.cc. The file
is corrected in the course directory. In the manual, the lines "// while
( ! infile.eof() )" and "// infile >> grade;" should not be commented out,
while the line "while ( ! ( infile >> grade ) )" should be removed.
FYI: The author incorrectly modified the program to a common C++ input
style. For this style to be correct, the line should read "while ( infile
>> grade )" which would both input the grade and exit the loop when EOF
is reached.