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. Description: 1. Part 1- Required Assignment: a. Write code for the class GamePurse. It has the following interface Iclass GamePurse { int purseAmount; public: GamePurse(int); void win(int); void Loose(int); int GetAmount(); }; b. Win() function will add a winning amount to the purseAmount. On the other hand, Loose function will deduct an amount from the purseAmount. GetAmount() will return the value of "purseAmount". c. Write a program that allows you to play the dice game repeatedly until the user chooses to quit. User needs to bet a positive amount to play a game. d. 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 Your dice is 5 Computer dice is 3 You won 10 dollars! Your game purse now has 110 dollars Enter a bet amount to play (0 means exit the program): Your dice is 4 Computer dice is 6 You lost 5 Your game purse now has 105 dollars Enter a bet amount to play (0 means exit the program): You choose to exit the program. Thank you and goodbye

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
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.
Description:
1. Part 1- Required Assignment:
a. Write code for the class GamePurse. It has the following interface
Iclass GamePurse
{
int purseAmount;
public:
GamePurse(int);
void win(int);
void Loose(int);
int GetAmount();
};
b. Win() function will add a winning amount to the purseAmount. On the other hand,
Loose function will deduct an amount from the purseAmount. GetAmount() will return
the value of "purseAmount".
c. Write a program that allows you to play the dice game repeatedly until the user chooses
to quit. User needs to bet a positive amount to play a game.
d.
The output of the program may be like the following
Welcome to the dice ware game. You have 100 in your game purse.
Transcribed Image Text: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. Description: 1. Part 1- Required Assignment: a. Write code for the class GamePurse. It has the following interface Iclass GamePurse { int purseAmount; public: GamePurse(int); void win(int); void Loose(int); int GetAmount(); }; b. Win() function will add a winning amount to the purseAmount. On the other hand, Loose function will deduct an amount from the purseAmount. GetAmount() will return the value of "purseAmount". c. Write a program that allows you to play the dice game repeatedly until the user chooses to quit. User needs to bet a positive amount to play a game. d. 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
Your dice is 5
Computer dice is 3
You won 10 dollars!
Your game purse now has 110 dollars
Enter a bet amount to play (0 means exit the program):
Your dice is 4
Computer dice is 6
You lost 5
Your game purse now has 105 dollars
Enter a bet amount to play (0 means exit the program):
You choose to exit the program. Thank you and goodbye
Transcribed Image Text:Enter a bet amount to play (0 means exit the program): 10 Your dice is 5 Computer dice is 3 You won 10 dollars! Your game purse now has 110 dollars Enter a bet amount to play (0 means exit the program): Your dice is 4 Computer dice is 6 You lost 5 Your game purse now has 105 dollars Enter a bet amount to play (0 means exit the program): You choose to exit the program. Thank you and goodbye
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education