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:
- Use predefined classes in a meaningful way.
- Divide a large problem up into small problems.
- Do everything necessary to
create, debug, and run a Java program.
- Use comments to delineate
each section of the program.
- Adhere to a Style Guide.
- READ
AND FOLLOW DIRECTIONS!!!!!
Deadlines
- Submit: January 25, 2012
by
11:00pm.
- Report: January 26th, 2012 at the beginning of class.
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
- 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
- You should not add any instance variables to any of the classes without
seeing the instructor and justifying such an addition.
- Any additional methods that you add should be made private.
- Your program must conform to
standard Java programming standards and the additional standards for
this class. See the Style Guide for your class.
- 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
- Your program will be
evaluated both on its correctness and conformance to the required Style
elements.
- You will achieve a grade of
80 points for a program that runs correctly
and produces exactly the required output in the required format on time.
- The remainding 20 points
will be
based on your conformance to the Style Guide and other requirements of the
assignment. Review the Style
Guide before submitting your
program and the grade sheet which is produced by the submit system.
- All grades will be based on
100 points.
- You may submit any number of
times. The only one I will count is the one that corresponds to the
hardcopy report that you turn in.
- The hardcopy that you turn
in will be the formatted version that
I will check. Make sure it has no line wraps or other spacing
issues.
- Successfully submitted
programs that are late will be graded, then the late penalty is
assessed for each day late according to the following schedule.
For
submissions after:
- January 25 - 5 point penalty.
- January 26 - 15 point penalty.
- January 27 - 25 point penalty.
- January 29 - 35 point penalty.
- January 30 - 45 point penalty.
- January 31 - 55 point penalty.
- February 1 - 100 point penalty.
Hardcopies must be turned in to the next class period after the successful submit, or January 26th whichever comes later. Late hardcopy will accrue a 10 point penalty.
HINTS
- This is a big problem that can be broken up into many small problems.
We did a lot of that design for you, but you may find that you want to add some additional methods. Please feel free to do so.
- When you are finished with the PA, the instructors will provide both a model solution to the problem as well as the GUI and text based game code.