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
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
Related questions
Question
100%
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education