Laboratory Notes

Program Development

You can develop your programs anywhere but the I will be grading the programs on the machine onyx, which runs  Fedora Core Linux.

Programs written under the Java compiler under any system will most likely run without any problems on any other system. You can submit your programs from onyx or from any of the workstations in the lab.

Protecting your work

Create a directory cs242 inside your home directory. In the cs242 directory, create one directory for each programming assignment. For now go ahead and create directories p1, p2, p3, p4, p5 and p6. For the first assignment, you will be using the directory called p1 in the directory cs242. Protect your class directory cs242 as follows:
chmod -R o-rwx,g-rwx cs242
The second command removes any access to the files in the cs242 directory by all other users. Then check if the protections are set correctly with an ls command as follows:
ls -ld cs242
drwx------ 2 amit students 1024 Feb 1 08:56 cs242
The d signifies that cs242 is a directory. The next three characters rwx tell us that the user (or the owner) of the file has read, write, and execute access. The next three characters --- tell us that anyone in the group students does not have read, write, and execute access. Normally you don't want to give write access to anyone except yourself (the user). The last three characters --- tell us that the others (that is, those not in the group) do not have read, write or execute access.

Submitting the Program

All of your work should be in one subdirectory. Let's say you have created a directory cs242 inside your home directory. Then create a directory pn (where n is the assignment number) in the directory cs242 and cd to this directory. All your programs and related files should be in this directory.

The timing results and any other comments should be in a file called README. Make sure that the README has your name, class, and assignment number at the top.

You should have a makefile that compiles and generates your program. The name of the executable must be as specified in the handout describing the programming assignment.

Before submitting your assignment, please remove all object files (*.o) (or .class files ) and executables since I will be running your makefile to regenerate any executables.

Once you are ready and in the directory cs242/pn, you can submit your assignment number n as follows:

 submit amit  cs242 n
The command will copy the contents of your current directory (recursively) and make a copy somewhere in the instructor's home directory that only the instructor can access. If there is a problem, then you will get an error message. Note that you can submit either from onyx or any of the Linux PCs in the lab.