horizontal rule

 

CS 140U
ASSIGNMENT 8
50 POINTS
DUE announced in class

 

NAME:

Instructions:

Do the steps in each of the following questions. For each question write the command(s) necessary to do the steps.

1) Copy the /home/staff/si/CS140U/PROGRAMS/C++/hw8.c file to a directory in your account (name it the same). Compile and link this file using the C++ compiler on UNIX (the aCC command) such that default executable file is created. Run the program using the following input strings:

a) Hello<CR>
b) This is fun<CR>
c) END<CR>

2) Compile and link hw8.c file one more time such that the executable file will be hw8.exe file (use a CC command with option -o). Run the program using the new executable file and the data in question 1.

3) Create a file named "hw8_main.c" containing the lines above the "----8<clip>8----" line, and a file named "hw8_fun.c" containing the lines below the "clip" line. Do not retype the code! Use cp and/or vi.

4) Compile and link the above files using the aCC command. Name the executable file hw8.exe using the appropriate option of the compile command. Run the program using the data in question 1.

5) Copy the /home/staff/si/PROGRAMS/C++/makefile file to the directory containing the files in question 3. This makefile needs two more lines at the end before it can be used. Add these lines, then using this makefile, re-compile your program and execute it as you did in question 4.

 

 

horizontal rule

Back to CS140U Homepage
This page was last modified September 26, 2004
wmorales@pcc.edu