subject

Challenge 16A - Rolling Dice package: chall16A
class: Main, Dice

Part 1

Create a class called "Dice" which we will use to instantiate a pair of six-sided cubes we generally call "Dice".

The class should keep track of its face value
It should be able to roll a random number between 1-6.
Constructor should store die value.
It should be able to return the face value when called.
Part 2

Create a methods for rolling the dice.

One method for returning the value of a single dice roll.
One method for returning the sum of a pair of dice rolled.
You need to be able to access the individual face values of each Die.
Part 3

In the Main driver class create a program that rolls a single Die 1000 times and calculates the percentage of times it rolls a six.

Part 4

In the Driver class create another program that rolls a pair of dice and calculates the percentage of times out of 1000 you roll 2 –ones (Snake Eyes) and the number of times you roll just 1 – one.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
question
Computers and Technology, 23.06.2019 18:00
Which is a possible benefit of having a good credit history? having a checking account low interest rate on a car loan high interest rate on a credit card offer bankruptcy
Answers: 1
You know the right answer?
Challenge 16A - Rolling Dice package: chall16A
class: Main, Dice

Part 1
Questions
Questions on the website: 13722361