Coders Packet

Dice Rolling Simulation using Java

By Soham Ghosh

The project simulates the rolling of dice and also finds the number of times each number on the dice occurs using Java.

A dice consists of six faces, each representing numbers from 1 to 6. In this project, at first, the no. of times the dice has to be rolled is input from the user with the help of the Scanner class and stored in a variable n. 

A loop is run n times and at each iteration, a number between 1 and 6 is generated using Math.random() and displayed. The frequency of the occurrence of each number is also maintained using an array count[]. Then, after the dice rolling is completed, the contents of count[] are displayed. 

Download project

Reviews Report

Submitted by Soham Ghosh (sohamghosh1509)

Download packets of source code on Coders Packet