CS239 Advanced Programming

Software Requirements Specification

Programming Assignment 2- File IO

Yahtzee - V2

Due Sunday, February 5, by 11:00pm

Hardcopy Due Monday, February 6 at the beginning of class

Updates will be posted on Piazza. If an update affects this web page, it will also be posted here and highlighted.

Inconsistency in the due date time is corrected. - 01/17/2012

Link to an online game provided - 01/18/2012

Update to YahtzeeTester.java - This is now ready to use - 01/19/2012

Update to YUtil.java - The points values for full house and the two straights were mixed up. They now match the game play. - 01/19/2012

Update to Die and Dice - See the Piazza announcement for reasons. You should download new copies. - 1/19/2012

A small straigth is only scored 30, not 35. Corrections are made to submit - 1/22/2012


Introduction

Purpose: Yahtzee is a dice game played with 5 identical dice. The goal is to get as many points as possible by rolling different combinations of dice. http://en.wikipedia.org/wiki/Yahtzee for a full description of the rules and scoring. This is a site with an online version of the game: http://www.zeedice.com/game1/

Objectives - At the conclusion of this exercise the student will demonstrate that they can:

Deadlines

Prerequisites

You have covered the material in Chapter 6, 8.1-8.7 and 9 of Gaddis.  

Program Structure

You are a part of a team of programmers working on this game. You have been assigned to create the YUtil class which will hold the information about the game and will have checker methods to insure that a hand is valid and score the hand. Your class will be used by two applications; one is a GUI version solitaire game and the other is a text version multiplayer game. You have been given a YahtzeeTester program written by the Quality Control department to test your program, although you are encouraged to do your own unit testing.

Your application will consist of 4 classes several of which have been written for you.

Die.java represents a single Die object. This has been completed for you.

Dice.java represents a collection of Die objects. You will likely find a need for a copy constructor to enable you to sort a set of dice for scoring while maintaining the original order of the Dice. This has not been written but it has been stubbed out.

YUtil is a Utility class which contains constants and methods helpful in game play. It will be used extensively by both versions of the final appliation. You must write most of this yourself, although you will find that the engineering team has created a few of the methods and all of the constants. Your job is to finish these methods.

YahtzeeTester is the class which contains the tester for your application. To be accepted, it must pass all tests.

Program Behavior

  1. Your program should successfully apply the scoring rubric that you find in the description of each method based on the set of dice passed in. Note that no method should change the set of dice in any way. You may, if you wish, build the copy constructor in Dice and change a copy of the original Dice object.

Output and Error Handling

You do not need to be concerned about output or error handling as that has been done for you.

Additional Program Requirements

  1. You should not add any instance variables to any of the classes without seeing the instructor and justifying such an addition.
  2. Any additional methods that you add should be made private.
  3. Your program must conform to standard Java programming standards and the additional standards for this class. See the Style Guide for your class.
  4. You should, for your own benefit, write a tester that will test the various methods that you are building and the classes that you are using.

Honor Code

This work must conform to the JMU Honor Code and the specific requirements of this class. NO help may be provided by any student to another student. Authorized help is limited to your textbook, the TAs for any CS139 or CS239 section, and the professor for your section. Be sure to acknowledge any help that you do receive from a TA. See collaboration policy.

Grading

        For submissions after:

HINTS