Question: Provide a game solution using C++ language. It is important that we can use a set of C++ features to solve problem. Develop solutions that

Provide a game solution using C++ language. It is important that we can use a set of C++ features to solve problem.

Develop solutions that use class features for C++.

Create *.h files and *.cpp files for classes.

Implement operator overloading Description:

1. Part 1 Required Assignment: Add comparison operators to Dice class a. Enhance your Dice class so that it has the == comparison operator and !=

b. So, when you compare 2 dices, dice1 and dice2, it will be true if both dices have the same value. It should return a false if the 2 values are not the same.

c. Use this operator in your code to determine if the user has a pair of same value, (or the computer has a pair of same value).

d. Also create a friend function so that the following statement will work. std::cout << dice; // will display the value of the dice

e. Use this operator when you display the output of the program

f. Overload the + and - operators for GamePurse class so that you can have GamePurse myPurse(100); myPurse = myPurse + 10; myPurse = myPurse -10

g. The output of the program may be like the following Welcome to the dice ware game.

You have 100 in your game purse.

Enter a bet amount to play (0 means exit the program):

10

You have 5 & 5

computer has is 3 & 4

You won 10 dollars!

Your game purse now has 110 dollars

Enter a bet amount to play (0 means exit the program):

5

You have 6 & 4

computer has is 1 & 1

You lost 5 Your game purse now has 105 dollars

Enter a bet amount to play (0 means exit the program):

10

You have 1 & 2

computer has is 3 & 4 You lost 10

Your game purse now has 95 dollars

Enter a bet amount Enter a bet amount to play (0 means exit the program):

0

You choose to exit the program.

Thank you and goodbye

Note:-(programme should be in oop concept)

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!