Project 2: Conditionals and Loops

Start: Thursday 9/18; Due: Monday 9/29, by the beginning of class


Overview

Several of the projects (and this one in particular) will be taken from the assignments on the book's web site. In those cases, I will typically make some comments on differences I might have with that assignment, as well as clarifications about what I am expecting from you. Mainly, however, I will ask you to carefully read through the assignment and do that. In this case, the assignment is Conditionals and Loops.

You should work on this project individually.

Specific tasks

You should first create a folder/directory called "Project2". You can do this by creating a new Java project in Eclipse as I will demonstrate in lab. The assignment asks you to write five programs named Ordered.java, RGBtoCMYK.java, Checkerboard.java, RandomWalker.java, and RandomWalkers.java. You should create Java classes with the corresponding names; for example, you would create the Java class Ordered for the Ordered.java source file. As you create each class, you will find it helpful to create a stub for the main(String[] args) method. (Again, I'll demonstrate how to do this using Eclipse.)

Be sure that your programs take input and give output exactly as described in the lab. (I'll show how to provide the command line arguments when running your programs in Eclipse.) In particular, you should get exactly the same output as given in the sample runs for the first three programs. Your output for the last two programs should have the same form as the samples, though the values likely will be different due to randomness.

I expect you to follow the standard Java convention regarding capitalization of names, even though our textbook's authors didn't. The names of variables and methods should always start with a lower-case letter, whereas the names of classes should always start with an upper-case letter. In particular, your Checkerboard, RandomWalker, and RandomWalkers programs should not use the variable name N, nor should RandomWalkers use the variable name T.

In addition to the Java program files, we want you to create a readme.txt file in your project. I'll demonstrate how to do this in Eclipse. Start by pasting in the contents of the template readme.txt file linked here, which is a slight variation of the one the authors use at Princeton. Then fill in each section as indicated in the template.

Gradesheet

We will use this gradesheet when grading your lab.

Submission

You should create a "zip" archive file containing all five Java programs and your readme.txt. Assuming you are using Eclipse, you can produce the zip file by exporting your project to an archive file. Here is a step by step guide on how to do that. Be sure to include the readme.txt in your project in Eclipse. I will demonstrate this if the instruction is unclear. Submit the zip file via Moodle, being sure to select f-mcs-178-003, which is the lab section.