Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Objectives: 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:-program 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

Step: 3

blur-text-image

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 2 Lncs 8056

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013th Edition

3642401724, 978-3642401725

More Books

Students also viewed these Databases questions