

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Lab; Class: Programming & Problem Solving II; Subject: Computer Engr & Computer Sci; University: California State University - Long Beach; Term: Spring 2003;
Typology: Lab Reports
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Continuing from Lab4, this assignment will move us closer to a card-game software. For this assignment, you will expand on a driver program, create a data structure designed to hold a play entry with the following information: player ID, bet for the play entry, and the hand of cards for this play entry, and a data structure designed to keep track of a card game such as poker. The driver program is provided to you in a file named lab5.cpp. You will also need a List class, which is based on the simple linked list implementation given in Chapter 4 of our textbook, as well as the Card, Deck, and Hand classes that you developed in previous assignments. INPUT : Response to program prompts for player names, and bet amounts. OUTPUT : The 5-card hand that each player receives from the initial dealing of 5 cards in a card game in the following format: Player Name Card1 Card2 Card3 Card4 Card5 Ante Amount Output each hand on a separate line. As developed in the Hand class in Lab4, the value of a card should show the face value (A for Ace, 2 for Two, , T for Ten, J for Jack, Q for Queen, K for King), followed by the suit (C for Club, D for Diamond, H for Heart, S for Spade.) For example, a Three of Spade should be displayed as 3S. REQUIREMENTS : Use the Card, Deck, and Hand classes you developed in previous assignments, i.e., specifications on these classes as given in previous assignments still apply. Create a PlayEntry class for holding information of an entry in a card game like poker. A PlayEntry object should record a hand, the player of this hand (using player ID would suffice), and the current bet amount on this particular hand. Create a Game class to keep track of a particular game. It should record the current total amount of bets in the pot, and a list of all play entries that are still in the game (i.e., play entries with hands that are not yet folded). Use the List class as provided in the collection of files in ~lam/274/lab5 to keep track of all the play entries in a given game. The List class is implemented with exception handling. When using functions in the List class that are implemented with exception handling, appropriate catch blocks must be included. Use the Player struct provided in Player.h for the recording of player information. Add more fields and functions if necessary. Use the driver program provided in ~lam/274/lab5/lab5.cpp as a basis to complete the implementation of the initial round of card dealing in this card game software. Demo must be done using the UNIX make command. Do the following: Create a lab5 subdirectory in your 274 subdirectory, and copy all publicly readable files from ~lam/274/lab5 into your lab5 directory. Also copy all the .h and .cpp files for the Card, Deck, and Hand classes you completed in previous labs into your lab5 directory. Document your program following the Program Documentation Guide which may be accessed through http://www.cecs.csulb.edu/~lam/cecs274/course-notes.html. Specifically, document every function in all classes in the form of a contract, for the PlayEntry anf Game classes you develop as well as all other non-library classes that you need to use or complete. Make sure that all comments designed for instruction purpose are removed or replaced where appropriate. Use UNIX " make " command to simplify your compile and link procedure. Turn in a copy of your source code, the makefile, and output of a test run. Demo your program on the due date. Demo must be done using the UNIX make command. Shui Lam (Spring 2003)
Shui Lam (Spring 2003)