Threesuns

Email

Contact

All Semesters

Semesters

All Courses

Courses

Introduction to Java Programming

CSCI2133

3 credits

Labs

Dice Roller

Lab

100 points

Requirements

Comments placed in each source code file.5
Files put into executable JAR format5
Application source and class files included.5
Program compiles and executes without errors5
Program layout is reasonably similar to example (bottom of page)20
Program performed input error checking20
GUI functions properly20
Program produces the correct outputs20
Total100 pts

Objective

Use of Objects, Event Handling, Classes and GUI components.

Instructions

This program will simulate the rolling of two dice and will make use of a Die class (see the RollDie.java program for an example of how to use it, RollDie.java will not be used in the lab, it is only an example of using the Die class).

The user of the program will be able to choose the number of sides for the dice between 2 and 100 (even if it is not physically possible).

The program should then allow the user to either roll the dice once or 36,000 times and should display the odds of rolling any possible total of the two dice.

When the user rolls once the program will display the value rolled on each die and the total of the two dice.

When the dice are rolled 36,000 times the program should keep track of the percentage of the time that the possible totals are rolled and the actual number of times that each total is rolled. This is not necessary when rolling once. The calculated odds and the actual percentages should be similar if the program is working correctly.

JScrollPanes should be included when appropriate.

Extras