Lab03, CISC105 Summer 2005
Directions
- Write a program for each of the following problems. If you wish, you
may start each program using a previous program as a base and then
modifying it, BUT you will learn more if you code each one from
scratch. Be sure to save every separate program. All programs must be
properly commented and indented (see
Assignment Standards on the class
website).
- Some programs below are associated with a question. Answer the
question using comments in your code.
- During your scripting of the programs, you will compile and run each
one. If a program does not compile, don't try to run it (because a.out
will not have been created).
- Name each program lab02.n.c, where n is the number in the list
below. For example, the name of the file for the first will be lab02.1.c
Practicing UNIX
Create a directory for this lab and then go into that directory to
create, compile, and execute your programs.
Run ls -la
Programs
You should have a total of 11 programs named lab02.1.c to
lab02.11.c. Make a single script file (see lab00 for the instructions)
where you cat, compile, and run each one in its final form (if it
didn't compile, don't run it in the script - mark the place in the
printed script file with a marker so it stands out).
Note: Cat, compile, and run each program in order! Do not
cat all programs, then compile, etc.
Execute your program multiple times to show that you tested the
program well.
More Practicing UNIX
As discussed in class, run ls -la
in your lab02
directory. In your printed script file, label the columns for the
files' permissions, sizes, dates, and names. Then, label the largest
and smallest files and the oldest and newest files. (10 points)
Submission
Email the tar file to Gang by midnight on Wednesday (see lab00 for
directions). Give the paper version to Gang at the beginning of your
next lab. (15 points for each submission.)
Grading
Grading is as noted above for each program, 10 points for
demonstrating your use of UNIX plus 15 points each for the electronic
and paper submissions, for a total of 200 points.
Adapted from Terry Harvey and Phill Conrad.