Homework 2
Spring 2011
Written part due in lecture, Thu, Feb 3
Program submission due: Feb 3 @ 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.
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/cosc071/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 seva$ cp ~maloofm/mm.cshrc ./.cshrc <--- Copies settings for your account seva$ source .cshrc <--- Applies those settings seva%
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., prog11.cc). So, to submit prog11.cc for this assignment, you type:
seva% java -jar submit.jar -a hw2 -f prog11.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 net ID, the spelling of which is critical. You should not need to provide this information again.
You must submit your program before 5:00 PM on the due date. The written part of the assignment is due in lecture.