CSci 2101 Lab 5. Programming with Java classes.

Tentatively: 50 points

Wiki page to upload your work: https://wiki.umn.edu/UMMCSci2101Fall2011/WarCardGame

The lab is done in pairs.

Part 1: finishing the Card class

Fill in the missing methods of the Card class. The current version of the class itself and the testing class is on the wiki (see the link above). I added comments and stubs for all methods that are called in the testing class. This will be done all together, the "Coding Dojo" style.

Part 2: figure out other classes needed for the game.

Every group proposes classes and their key methods. Then the sketch of the solution is written. This will also be done all together.

Part 3: implementing the needed classes.

Every group implements and tests their classes. Make sure to put your names in comments so that other groups know who the authors are in case something needs fixing or tweaking.

Please pay attention to the methods' specification. If anything is unclear, verify it with the relevant group or groups. Failure to follow the specification and failure to communicate when such communication is needed will result in a lower grade.

Part 4: testing another group's code.

Groups that are done with their code will test other groups' methods. If a problem is discovered, contact that group and work with them on fixing the issue.

Part 5: putting it all together and final debugging.

The code is put together. Necessary final tweaking is done.

Part 6: a follow-up assignment (due Friday Oct 7th at 11:59pm)

This is an individual assignment, 15 points

Using the same Card, Deck, and Player classes that we used for putting together the game in the lab, and the other Game class (by Eric, Chase, and Kelsey with the help from Kevin, Nick, and Miles), put together another version of the war game. Your tasks include:

  1. Fixing syntax errors, if any. Comment every line of code that you fixed.
  2. Running the program several times to see if it runs as it should. If it doesn't, fix the issues. Once again, clearly comment what you have changed. Rerun the game to convince yourself that it works as it should. Recall that Ctrl-C stops infinite loops.
  3. When you are done, go through the code and make at least three changes that make the code easier to follow. They may be: renaming variables, adding comments, changing indentation, separating some functionality into a method. Clearly comment all your changes. Make sure to rerun the program after you make the changes to check that your changes haven't broken the functionality.

Part 7: enjoy the game!

How to submit:

Send me all of the code you worked on at the end of the lab (CC your group). The lab grade is based on in-class activities and the code sent to me at the end of the lab (or, if final, incorporated into the solution).


CSci 2101 course web site.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.