Princeton University
COS 217: Introduction to Programming Systems

Assignment 0: Introductory Survey


Purpose

The purpose of this assignment is to help you learn the basics of the Linux operating system and the Bash shell. The assignment also will inform us instructors about your background relevant to the COS 217 course, thereby helping us to (1) confirm that your background is appropriate, and (2) advise you throughout the course.


Rules

Make sure you study the course Policies web page before doing this assignment or any of the COS 217 assignments.


The Task

Your task is to take the COS 217 survey and submit your answers.


Procedure

Do all your work on the armlab cluster following the procedure below.


Step 0: Create a Proper Computing Environment

Create a proper COS 217 computing environment by completing the steps in the A Minimal COS 217 Computing Environment document from the first precept.


Step 1: Copy the Survey Program

Start a terminal session and log into armlab. At the Bash shell prompt issue this command:

mkdir surveyproj

to create a project directory named surveyproj subordinate to your home directory. Then issue this commmand:

cd surveyproj

to make your project directory your working directory. Finally isssue this command:

cp /u/cos217/Assignment0/conductsurvey.c .

to copy the conductsurvey.c file from the /u/cos217/Assignment0 directory to your working directory.

The conductsurvey.c file contains a program written in the C programming language. We encourage you to read the program, but you are not responsible for understanding it at this point. (It uses some advanced features of C that we'll cover later in the semester.)

Step 2: Build the Survey Program

Issue the command:

gcc217 conductsurvey.c -o conductsurvey

to use the conductsurvey.c file (which contains source code) to build the conductsurvey file (which contains executable code).


Step 3: Run the Survey Program

Issue the command:

./conductsurvey

to run the conductsurvey program and thus take the survey. Read the instructions carefully and answer all questions.

After you've answered all questions, the conductsurvey program will finish and the Bash shell prompt again will be active. The result will be a file named survey in your working directory.


Step 4: Examine the Survey Results

Make sure that you took the survey properly. To do that, issue this command:

ls

to display the names of all files in your working directory. One of those files should be named survey. Then issue this command:

cat survey

to examine the contents of the survey file. The file should contain your survey responses.


Step 5: Submit the Survey Results

Issue a submit command to submit the results of the survey. More specifically, issue this command:

submit 0 survey

to submit the results of the survey.

The instructors maintain for you one submission directory for each assignment. The submit X file1 file2 ... command copies the specified file(s) to your Assignment X submission directory. For example, the submit 0 survey command copies your survey file from your working directory to your Assignment 0 submission directory.
Instead of issuing a submit X file1 file2 ... command, you can issue a submitandbackup X file1 file2 ... command. The submitandbackup X file1 file2 ... command first copies the specified file(s) to your Assignment X submission directory, just as the submit X file1 file2 ... command does. Then it creates a directory subordinate to your home directory whose name is of the form BACKUP_X_date_time, and creates a backup copy of the specified file(s) in that directory. If you consistently issue submitandbackup commands, then you'll have a record of which files you submitted, when you submitted those files, and the contents of those files.
You can resubmit a file. For example, if you submit a file named survey to your Assignment 0 submission directory and then later submit another file named survey to your Assignment 0 submission directory, then the new version of survey simply overwrites the old version of survey in your Assignment 0 submission directory.
You can issue unsubmit commands to delete specified files from your submission directory. For example the command unsubmit 0 survey deletes the survey file (which, presumably, you submitted previously) from your Assignment 0 submission directory. The unsubmit program does not affect files in your working directory.

Grading

We will not grade your Assignment 0 submission. However, your Assignment 0 submission is required. We will not accept your submissions for subsequent assignments until you complete Assignment 0.


This assignment was written by Iasonas Petras
with contributions by Robert M. Dondero, Jr.