Project 2: Conditionals and Loops

Start: Wednesday 2/28; Due: Monday 3/12, by the beginning of class


Overview

Special annoucement for the students of MCS-178 : professor Yu will be presenting in a conference in Osaka, Japan from 2/28 to 3/4. So, you will be spending 2/28, 3/1, and 3/2 working on this project (please see the schedule page). This is unlike previous semesters. As a result, all of the lectures prior to project 2 will be pushed ahead in order for you to spend those three days working on it. Thus, it is very important for you to work on project 2 deligently. You should go to the tutors frequently, if only to use that time and environment to work. If you are stuck, get the tutors to help you. Remember to give me feedback as you are working on project 2. If you have problem finishing it even though you had worked very hard, please let me know.

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 file (readme.txt) 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 2018 s-mcs-178-001, which is your lecture section.