Homework 2
Spring 2007
Written part due in lecture, Thu, Feb 1
Program submission due: Feb 2 @ 5 PM
5 points
This homework is designed to get you familiar with entering, compiling, and submitting C++ programs.
As you know from lecture, g++ is available on seva, the department's student machine. Here are some pages that will help you complete these tasks:
You'll be submitting all projects this semester with a submit program, which you'll need to copy from my directory to your directory. Instructions follow.
A simple editor on seva is "nano", which is a full-screen editor. nano has on-line help, and there is also documentation on the nano home page. For nano, once inside the editor, you can type Control-G to get help.
If you plan to take additional CS courses or to develop further your programming skills, then I'd highly recommend learning either "vi" or "emacs". nano is simple, but it is also simplistic, especially for editing C++ code. vi and emacs are industrial-strength tools for writing programs.
Note: For problem 2.8, remove both include statements.
You first need to get a copy of the program you'll be using to submit your projects. On seva, you need to copy the submit program from my directory to yours. At the prompt, which I'll assume is seva$, type the following commands, hitting the enter key after each line. (What you type is set in boldface. Everything else is a comment or something the computer prints.)
seva$ cd ~ <--- Changes the directory (cd) to your top-level directory (~) seva$ cp ~maloofm/submit.jar ./ <--- Copies (cp) the submit program (submit.jar) from my top-level directory (~maloofm) to your current directory (./) seva$ ls <--- Lists the files in the directory submit.jar <--- You should see submit.jar in the list
submit.jar is a Java program that will take a file and send it to the machine we use for grading. To submit a file for an assignment, you type at the seva prompt:
seva$ java -jar submit.jar -a <assignment> -f <file>where <assignment> is the name of the assignment (e.g., hw2) and <file> is the name of the file to be submitted (e.g., prog211.cc). So, to submit prog211.cc for this assignment, you type:
seva$ java -jar submit.jar -a hw2 -f prog211.ccN.B. The submit program currently doesn't like file names with hyphens and underscores, so please avoid them.
The first time you use the submit program, it will ask you for your name, the spelling of which isn't important, and your net ID, the spelling of which is critical. You should not need to provide this information again.
The TAs who will be grading your projects this semester are listed on the main page. You must e-mail your project before 5:00 PM on the due date for the e-mail portion of the assignment.