Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

Solve Problems 121 using ips units. AS 568A No. 320

Answered: 1 week ago

Question

Does it use a maximum of two typefaces or fonts?

Answered: 1 week ago