Lab 2

For this lab, you will progress through a sequence of terminal commands in order to accomplish the given tasks.  

If you don't have a home directory, when you submit to blackboard, put "No account" instead of your cs account name where requested.  If you're using Sean's account, rather than the home directory, create a folder with your name on the desktop and use that as your home folder.  Otherwise submit as below.

As a reference, check out the page on UNIX command posted by the CS department at http://www.cs.uic.edu/~consult/how/unix.html.

Also as a source on redirection, here is a page that explains it: http://www.westwind.com/reference/os-x/commandline/pipes.html.  Despite saying OS-X, the description is still valid.

Be sure you note point 7 before you begin!!

From the terminal, you should do the following:

1. Navigate to your home directory.  This command should work regardless of which directory the terminal is currently in.

2. Create a directory named Lab 2.  This should be a single directory with a space in the name between Lab and 2.

3. Write a C (pure C) program called Lab2.c which outputs your name and CS account username.  

    Then, in a new line, fill in the blank of the following statement.  "My favorite computer application is _______."

4. Compile the program, calling the executable Lab2Program.exe rather than a.out.

5. Run the program, redirecting the output to output.txt.

6. Rename the output from output.txt to Lab2output.txt.

As you complete this lab,

7. Put all the commands you used into a single file called Lab2Script.txt.

    This step does not need to be performed from the terminal, inside your favorite text editor is fine.

If you're going for the third point, complete the following two steps.

8. Repeat step 3, but rather than a C program, write a C++ program to do the same thing.

    Use the iostream library and the << operator for output.

9. From the terminal, compress the folder Lab 2 into a single archive.  Include this command in your Lab2Script.txt file.  You may use any available compression tool, there are multiple listed in the UNIX tutorial, but be careful that you are using the right suffix.

    Note that Lab2Script.txt should be inside the Lab 2 folder, so you may need to execute this step twice, once you figure out how it works and have edited the Lab2Script.txt file.

For 1 point, make the described program, and submit it to blackboard.

For 2 points, complete steps 1-7, and submit the program Lab2.c and Lab2Script.txt in a single archive (zip file) to blackboard.  Also, leave the files in your home directory, I'd like to be able to check them.

For 3 points, complete steps 1-9, and submit the resulting zip file from step 8 to blackboard.

    Make sure that you completed step 9 successfully, and that the archive actually contains the necessary files.