Threesuns

Email the Instructor

Contact

All Semesters

Semesters

All Courses

Courses

2013Fall

08.20.12 - 12.16.12

Introduction to Java Programming

CSCI2133

Monday Wednesday
04:00 PM - 05:20 PM

Dice Roller

Lab07

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

pastdue

Submit Your Solution

Lab07

Request a Copy of your Solution

Lab07

Requirements

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

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