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

image text in transcribedimage text in transcribedimage text in transcribed

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 class GamePurse int purse Amount; 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 "purse Amount". 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 (O 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 (O 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 (O means exit the program): You choose to exit the program. Thank you and goodbye 2. Part 2 - Optional Assignment 2: a. Create a class called Party and it should have a name data member and number of maximum people. It also has a data member to indicate guests who have made the reservation. It should member function to set and get number of guests reserved. b. Write the main program to test this class. Create a party named "Year of the rate", maximum people is 70. And 50 guests have reserved. 3. Part 3 - Optional Assignment 3: a. Last time we build a Card class and tested with three cards. This time we will add a class called Deck. An object of this class has 52 card objects, and we are required to use an array implement the cards. b. This class Deck should have the following interface: #ifndef DECK_H #define DECK_H #include "Card.h" class Deck Card *aDeck[52]; int topCard; public: Deck(); wDeck(); void shuffle(); Card &deal(); int remainCards(): 16 }; 18 #endif // DECK_H In the constructor, we need to create 52 cards and we need to shuffle the cards. We also need to specify position of the top card of the deck deal() will return a reference of a card. C. Write the main function so that it will get the deck object to deal three cards. And then is play the three cards So when we run the program, it can be like the following output The first card is 9 of Club Number of card available: 51, The second card is 5 of Club Number of card available: 50 The third card is Ace of Diamond Number of card available: 49 Press any key to continue... When we run of the program again, the output may be like the following screen The first card is 9 of Club Number of card available: 51, The second card is Queen of Heart Number of card available: 50 The third card is 5 of Spade Number of card available: 49 Press any key to continue ... Turn in Instruction Create a PDF file that has code and run output of the part 1 assignment. You do not need to turn in part 2 because it is an optional assignment Upload to Canvas at "Lab Assignment 3" section Miscellaneous Information You can search of an algorithm how to shuffle element of an array

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

can you tell me about chainreaction cycling company with references

Answered: 1 week ago