Brief Program Description:
Java and JSP only using Eclipse IDE
Deadline Tuesday March 8th 8am.
Craps is a dice game that you might enjoy if you were to visit many of the interesting
casinos on and off the tribal lands encapsulated within the United States. It can be
enjoyed solely for fun or for slowly donating your hard earned cash to the casino
owners. For this exam, you will create a Web application that will allow a user to
practice playing a round of craps, pretend to wager on the rolls of the dice, and then
calculate the wins/losses for that round. The user may then choose to enjoy additional
rounds of craps (but you need not keep up with the users wins/losses for multiple
You can read about the game of Craps at the following Web sites. You can visit other
sites if you wish. Use this information to understand the problem and how it might be
• Mastering Craps - [url removed, login to view]
• Craps Rules - [url removed, login to view]
Detailed Program Description and Requirements:
For your program, you must create an Eclipse project that contains Java classes, jsp
pages, CSS file(s), JUnit tests, and images as described herein.
Die class (required): A single die can be modeled as a Java class based on the
following Class diagram. You must create, include and use a Die class based on this
design. Your class should follow the design here for full credit. The setRandom() method
should set the value of the die object to a random integer from between 1 and 6,
JUnit test of Die class (required): Create a JUnit test for the Die object. You should
test the setValue and toString methods in your JUnit test class.
jsp pages (required): Your solution should include an [url removed, login to view] and at least one other
jsp file. The [url removed, login to view] file should be used as the entry point into your application. A
second jsp file should be used as the primary controller and view generator. You may
use additional jsp files if you prefer. Views should include:
• An entry view ([url removed, login to view]) that allows the user to enter at least a Pass wager and
click to make the Come Out roll.
2• Views to show roll and wager results if the user wins or losses on the come out
• A view to show the results and the Point once it is sent. The user should then be
allowed to add additional wagers. At a minimum, you should include at least 5
multiple roll wagers and 5 single roll wagers. After adding wagers, the user can
then continue to roll until they roll the Point (a win) or until they roll a 7 (a loss).
Your application should keep up with the wagers and calculate the final winnings
• Views to show the results after the user wins or loses after rolling for the point.
CSS file (required): Your solution should include CSS to style the pages. You should
include enough here to demonstrate that you can use CSS for:
• link to the same CSS file from all jsp pages
• centering the content in the page
• position the dice images
• set background colors
• style the fonts on the page
• style the form elements
• at least three other style items of your choice
• It's okay to include a minimal set of CSS within the jsp pages if warranted, but
keep most style commands in the external CSS file.
Dice images (required): After the dice are rolled, dice images with the appropriate
values should be used to display the values rolled. You should be able to find suitable
dice images on the Web.
Other Java Classes: You may use additional Java classes (not including
Servlets) for your solution as needed.
1. Your solution should include only the Java components (no servlets for this exam
solution) discussed in the instructions.
2. Any monetary values that you display in your pages should be displayed using
currency formats using Java NumberFormat class. Other values should be displayed
in appropriate units.
3. Use the Eclipse Java IDE to develop the game.
4. Due March 8th 8am