Submitting Code

This is the archived website of IC 312 from the Fall 2014 semester. Feel free to browse around; you may also find more recent offerings at my teaching page.

All code for the projects must be submitted electronically, from the USNA CS linux labs environment. All code is expected to be clearly commented and cleanly written so it is easy to understand. As always, you will be graded on the CLARITY of your submission and not just the CORRECTNESS.

Accessing the CS Linux environment

You can access the CS Linux environment by sshing to one of the machines in the Linux labs, which will have names like, where XXX is either 302, 303, or 316, and YY is any number from 01 up to 20 (or maybe 22). You can probably leave off the part if you are on the yard, by the way.

If you are using Windows, the PuTTy program is your best bet to access ssh. In Mac or Linux, the program is just called ssh. On Linux, if you get tired of typing your same USNA network password all the time, you can set up key-based ssh. First, on your laptop, run ssh-keygen -t rsa -b 2048, which will generate a new public/private key pair. It will prompt you for a new passphrase, which can be whatever you like (or blank). Then do ssh-copy-id michXXXcsdYYu (filling in your favorite hostname) to copy the public key to your Linux home directory. Thereafter, when you ssh from your laptop, it should ask only for your RSA passphrase, not for your USNA network password. Cool!

Also cool: if you are using Linux or Mac, you can easily mount your Linux home directory using the sshfs program. First, install the sshfs program. In Ubuntu and related Linuxes, this means you run the command sudo apt-get install sshfs. Next, add yourself to the "fuse" group: sudo adduser $USER fuse. Log out and back in again for the change to take effect.

Once you have sshfs installed, mounting is a 2-step process. First, make an empty "mount directory" that will act as a doorway to your CS Linux home directory, for example mkdir $HOME/mich. Then run sshfs michXXXcsdYYu: $HOME/mich to do the mount, where as usual you replace the hostname with your favorite and the directory with whatever you chose. (Note the colon in that command!!) To unmount the directory later, just do fusermount -u $HOME/mich


Unless otherwise specified, all code must be submitted as Java source code files ending in .java. There will be a single class indicated in the assignment that should contain the main method to run your program. You may also submit other .java files as needed to specify your classes, and you may also submit a README.txt file if there is any "special explanation" needed for anything.

All classes and functions must be documented with Javadoc unless it should be completely obvious to your instructor what that class or function is for. Your code will be judged on proper programming style (readability, documentation, and organization) as well as correctness.


I've set up some useful aliases for you so you don't have to type so many directories every time. To get these aliases at your command prompt, just run the following from one of the Linux lab machines:

source ~roche/312/setup

This will define some shortcuts (aliases) to run any programs we will need for this class. After you add this line, any new terminals will get the new commands as well.

The submit program

The program you will use to submit is located at /home/scs/roche/sub/submit, but can be run by typing 312sub if you ran the setup program described above. This program is accessible from the USNA CS linux environment. You can use it from the MI 302/316 lab or log into one of the machines remotely.

When you run 312sub with no arguments, it will display something like

Open submissions matching your search:
proj 1
This means, unsurprisingly, that IC 312 has one thing open for submission, it's a project, and it's number 1. To submit your file or files for this assignment, you make a directory in your account (like mkdir proj1), then put any files to submit in there.

Once you have your local directory, and you confirm that the assignment is open for submission, you cd to that directory and run

312sub proj 1
(for example) to submit your files. This will check your files, and then bundle and submit them to your instructor. At the end you will see something like:
Submitting 312 proj 1 for user roche to Dr. Roche..
Submission successful.
You can see that there is one file that was submitted, called hi.txt. Note the last line, telling me that it was successful. If you don't see this line, then something went wrong.

IMPORTANT: Any extra files that do not follow the proper naming convention will NOT be submitted. Make sure you check the list of files that was actually submitted to me, because that's all you will be graded on!

All this does is put all your files in a place where I can see them, with a timestamp and your username. You are free to submit the same assignment repeatedly, and I will only look at the most recent submission for grading purposes.