Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After unzipping the laundry.zip file, you can open the DrJava laundry project
by starting DrJava, setting the Language Level to Full Java, pulling down the Project menu and selecting the Open command. In the file chooser that pops up, select the project profile file laundry.drjava embedded in the file in the unzipped file tree for laundry.zip. You can save the project state at any point during a DrJava session using the Save command in the Project menu. You can also save individual files within the project using the Save button on command file or the File menu.

The Project Test commands runs all of the JUnit test files in the project.

Your assignment is to fill in the stubbed out members of the DoCommandVisitor and Student (members with degenerate bodies (either return; or return null;). In the process you may choose to define some new classes to support your Student class implementation. The Student class models the laundry habits of Acker. In our test simulations, we will typically only create a single instance of Student representing Acker, but your code should support multiple students (e.g., Acker and his brothers) at a time. Since these students do not interact with each other, supporting this form of multiplicity is a trivial consequence of OO coding style used in the framework.

...

Your program executes a loop that repeatedly reads input from an input "process" that returns Command objects. The input process (provided by our supporting
framework) reads a series of event description commands, one to a line, either from the console or from a file. The input process converts a stream of characters to Command objects which are passed to your program.

In addition to performing the specified commoncommand, your program should output a brief description of for each command that it performs in the exact format described below. In the following list of commands, the output line specifies what your program should print.

Code Block

receive _adjective_ _article_

means Acker received a gift of the specified article of clothing.

...

and updates the state of the StudentEnvironment.
For example,

Code Block

receive argyle socks

generates

Code Block
received argyle socks

and adds the argyle socks to the top of the socks pile on the shelf.

Code Block

lose _adjective_ _article_

means Acker misplaced the specified article of clothing.
If the item exists and Acker is not wearing it, the simulation outputs

...

and updates the state of the StudentEnvironment accordingly. If Acker is wearing it, the simulation outputs

...

and leaves the StudentEnvironment unchanged. If the item does not exist, the simulation outputs

Code Block
adjective article does not exist

and leaves the StudentEnvironment unchanged.

Code Block

change _article_

means Acker doffed the specified article of clothing, discarding it in the dirty laundry pile, and donned a replacement article using the protocol described above. In response, the simulation outputs

...

describing the article doffed and the article donned.

Code Block

{{launder}}

means Acker washed and dried a load of laundry. If the dirty clothes pile is not empty, the simulation outputs

...