Another dice game! This game is similar to the Doubles gameshown in class but is called ?HighLow?.
Question:
Another dice game! This game is similar to the Doubles gameshown in class but is called ?HighLow?.
This game has two players, you and the computer. Each player hastwo dice and starts with $100. The game begins with a bet from eachuser up to the amount they currently have. The players then rolltheir dice and the player with the higher dice total wins theirbet. The loser loses their bet amount. The game continues as longas you want or until one of the players lose all their money.
To begin creating this game, you are going to create a ?Player?class that encapsulates the amount of money they have and two Dieobjects (use the Die class from the Doubles game). The class willalso have a default constructor that sets the amount of money theyhave to 100 and two functions. The first function, ?roll?, will beused to randomize their dice. The second function, ?total?, will beused to return the total amount of their dice values.
Create a simple program to test your new class and itsfunctions.
Corporate Finance A Focused Approach
ISBN: 978-1439078082
4th Edition
Authors: Michael C. Ehrhardt, Eugene F. Brigham