Question: Using c++ . An int data field named faceValue that stores the face value of the die. A default constructor (set the default value to

 Using c++ . An int data field named faceValue that stores
Using c++

. An int data field named faceValue that stores the face value of the die. A default constructor (set the default value to a random number between 1-6) A constructor with parameter that creates a die object with the specified value in the parameter The getter and setter methods for all data field . A method roll) that "rolls" the die. Hint. This means the face value changes to another random number 1-6 An output method that displays This die has face value: "+X (where x is the face value) To generate random numbers include the following libraries at top of file "include and first line in main should be Using the Die class in your main function implement a simple dice game that a user can play against the computer. The object of the game is to be the first to score 20 points after repeatedly rolling 2 dice. The program asks the user for a number between 1 and 6 and creates a user die object with that face value. It also creates a second die object, computer die, in a default way. The program repeatedly rolls both dies until one of them hits the magic 20 points. After that the program prints to the screen whether the user die or the computer die won, OR if the game was a tie. Eg. Below are some face values after several rols User die: 3 computer Die: 6 User die: 5 computer Die:6 User die: 6 computer Die:4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!