Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:30, safi30360oz0c34
What kind of software users of all skill levels create web pages that include graphics, video, audio, animation, and other special effects? website authoring website software website publishing website editing
Answers: 1
image
Computers and Technology, 22.06.2019 05:00, mathman783
Which two editions of windows 7 support 64 bit cpus? choose two out of professional, business, starter, or home premium.
Answers: 1
image
Computers and Technology, 23.06.2019 21:30, shadoris26
To move a file or folder in microsoft windows, you can click and hold down the left mouse button while moving your mouse pointer to the location you want the file or folder to be, which is also known as.
Answers: 3
image
Computers and Technology, 23.06.2019 22:30, kayelynn003
How many points do i need before i can send a chat
Answers: 1
Do you know the correct answer?
Challenge 16A - Rolling Dice package: chall16A
class: Main, Dice

Part 1

Questions in other subjects:

Konu
Computers and Technology, 24.07.2019 02:30