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.
Computers and Technology, 23.06.2019 13:00, torresnoemi899
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.