Skip to content
Solved Assignments

Development of a Poker Game Application Using Object-Oriented Programming Techniques

Project focusing on object-oriented programming in game development.

Preview 9 of 27 pages

See the first 9 pages exactly as they appear in the document.

  1. Page 1
    Read page 1 as text

    Development of a Poker Game Application Using Object - Oriented Programming Techniques Based on the detailed description provided for a card game application, answer the following: 1. Explain the work plan process and its significance in project management. How does the Gantt chart help in minimizing idle time during project execution? 2. Discuss the Agile software development methodology and its advantages and disadvantages. How does Agile apply to game development, particularly in the context of a card game application? Mention the different Agile approaches and the key elements of the Agile process. 3. Provide a detailed description of the program plan for a poker game application. What are the main tasks involved, and how does the program use the Card and DeckOfCards classes to implement the game logic? 4. Describe the process of incremental development in the context of building a card game application. How does this methodology ensure a smooth and error - free development process? 5. Explain the design document for the program, focusing on the Card and DeckOfCards classes. What roles do these classes play in the poker game, and what functions are associated with them? 6. Write the code for the Card class in C++ that includes the necessary functions as described in the provided code snippet. Ensure that you explain the purpose of key functions like toString(), rearrange(), and replace(). Word Count Requirement: Your answer should be no less than 1500 words.

  2. Page 2
  3. Page 3
    Read page 3 as text

    Task 1: Work plan is the process in which planning for the work is done. Work plan is a systemized order of the work activities to be done. These sorts of projects are uncertain that is the time required for completion is not so clear. It is under the probabilistic approach. Gantt chart shows the every task in an order so that the idle time is clearly visible. Therefore, efforts must be provided to minimize the idle time. Gantt charts are used to represent the work plan of the projects. Gantt chart is used to represent the activities with the idle time in between these activities. Gantt chart for the work plan for the application developed in last week is shown below: Task 2: To simplify the process Agile software development. Agile developed is a methodology used to stream lined the SDLC. It is technique used for the face to face communication. The Systems Development Life Cycle (SDLC) refers to the end to end process of designing, building and delivering an Information System (IS) that will meet the requirements of the business processes. SDLC is divided into four main phases, these four phases consists of several steps which makes use of many techniques to complete the steps and thus produce deliverables that are provided to the customer. Approaches to agile development: • Extreme programming. • Dynamic system development method. • Scrum technique.

  4. Page 4
    Read page 4 as text

    The elements of agile development are as given below: 1. Testing : in this phase the components are tested against the issues in them. 2. Coding : if there are issues within the components then coding is done to prevent those issues. 3. Design : in this phase the tested and the coded components are designed. 4. Documentation: this is an important element. In this the components re documented for the purpose of the implementation. There are various a dvantages of agile development. Some of the advantages of agile development are as given below: • This process involves the simple and iterative application development in which the every iteration includes the testing, co ding, design and documentation. • Here the iteration cycles are kept short and a development team performs its requirement to imp lement the system successfully. This will remove the unnecessary steps like quality testing, beta testing. The agile development has various issues associated with it. Some of the issues with agile development are as given below: • It has complex nature. • These technologies are not so reliable. • Schedule visibility is not up to mark. • It is not very familiar technology. In this process the modeling and documentation is eliminated whereas face to face communication is preferred. The game development is selected by me. The steps and all tasks to show the working of card game application are described below: Task1: A serious game is the game with reason; this was not produced to be exclusively entertainment. It has all the essentials of an actual game, will appear and sense like a actual game, but has a number of defined reason, result or meaning the creator wish to obtain crosswise to you. The positive impacts of serious game are as given below: • Better visual abilities. • New method of learning. The negative impacts of serious game are as given below: • The behavior of player becomes aggressive. • Engage players from other activities.

  5. Page 5
    Read page 5 as text

    An environmental game is game like advance to aesthetics and usability, slightly than the adding of game rudiments. Someo ne can also name it good - natured design. A pleasant example of this is the stop working monster from Twitter. Rather than a uninteresting old mistake when twitter is in excess of capacity, they have the stop working Whale. This easy adapt in thoughts has spawn its own living, with public recreating the picture with dissimilar characters and still shaped t - shirts with it on. There are better examples, where game thinking has made user interfaces easier to use, but this is nice and simple. The positive impacts of environmental game are as given below: • Provide learning environment to the players and children. • Best utilization of time because player can learn thing while playing. The negative impacts of environmental game are as given below: • The demands of player increases on rapid bases. • Engage players from other activities. Task 2: Incremental Development Methodology : The incremental development technique helps develop the program in small incremental steps. We begin with an outline program and add code in steps to complete each task. At each step, first we design, then code, and finally test the program before progressing to the next step. This enables focus on a single program task at a time reducing the chance of errors in the program. Task 3 : Program Plan: • Define the classes Card and DeckOfCards . • In main , deal a five - card poker hand. • Define functions that check whether the hand contains two pairs, three of a kind, four of a kind, a flush or a straight. • Shuffle the cards, deal the cards. • First deal cards for player, then deal cards for dealer. • Based on the quality of cards for dealer, replace 1,2 or 3 cards and re - evaluate dealers hand. • Display result. Task 4 : Problem Statement :

  6. Page 6
    Read page 6 as text

    This application makes use of two classes named card and DeckOfCards to deal five hands of the poker game. On the bases of the quality of cards, the cards are replaced and result is displayed to the end user. Task 5 : Program Tasks: We can outline basic tasks required to accomplish the objective of the program. These tasks are described below: • Prompt user to input the cards . • Prompt user to replace the cards . • Display the dealer hands . Task 6 : Design Document (Class Descriptions) : The design document of the program describes the classes that we use in the program. This also includes the local scope diagram containing the main() method. The design document is illustrated in the table below: Design Document S. No. Class Description 1. Card This class of the program is used to show the cards to the end user. It contains various functions for operations. 2. DeckOfCards Find a random number between 0 and 51 and swap the card at that location with the current location . Task 7 : Program Development Steps and Assumptions: We will develop the program in steps given below: • Step 1 : Start with the program template and add code to retrieve user input as cards . • Step 2 : To extract the number of cards input by user. • Step 3 : Shows the message that whose hand is better. • Step 4 : Merge above codes and display the output .

  7. Page 7
    Read page 7 as text

    Task 8 : The code for the game of poker with its classes and various functions is as given below: Cards class: // Class header file: Card.h // Class members declaration #ifndef CARD_H #define CARD_H // Header files #include <iostream> #include <vector> using namespace std; Declare the data members face and suit . Dec l are two string arrays suits and faces . Declare the constructor function and the function prototype for toString . // Class declaration class Card { public : // default constructor Card(); // constructor Card initiliazes the data members Card( int , int ); string toString( Card& ); int pair( vector<Card>&); int threeOfAKind( vector<Card>&); int fourOfAKind( vector<Card>&); int straightHand( vector<Card>&); int flushHand( vector<Card>&); void compare(vector<Card>& , vector<Card> &); void rearrange(vector<Card>&, int c, int p); void rearrangeAce(vector<Card>&); void replace(vector<Card>&, vector<Card>&, int n); void sort(vector<Card>&); void player(vector<Card>&); private : // data members declaration int face; int suit; static string suits[]; static string faces[];

  8. Page 8
    Read page 8 as text

    }; // end class Package #endif // CARD_H Card.cpp file: // Member - function definitions of class Card. #include "Card.h" #include "DeckOfCards.h" using namespace std; // static member declaration string Card::suits[4] = { "Hearts" , "Diamonds" , "Clubs" , "Spades" }; string Card::faces[13] = { "Ace" , "Deuce" , "Three" , "Four" , "Five" , "Six" , "Seven" , "Eight" , "Nine" , "Ten" , "Jack" , "Queen" , "King" }; DeckOfCards dc; Card::Card() {} Card card; Constructor: The constructor function initializes the data members. // constructor initiliazes data members Card::Card( int csuit, int cface) { face = cface; suit = csuit; } // end Card constructor The function toString returns the face of the card as a string. // function toString string Card::toString( Card& c ) { return (faces[c.face]+ " of " +suits[c.suit]); } // end function toString The function pair finds a pair in the hand if any. Pair function: // function pair int Card::pair( vector<Card> & hand) {

  9. Page 9
    Read page 9 as text

    // array to record the number of cards of each rank in the hand int count[ 13 ] = { 0 }; int r=0, twoPair = 0, pair=0; The array hand contains objects of Card . To access the face of each Card object use hand[r].face . // find out the number of cards of each rank in the hand for ( r = 0; r < 5; r++ ) { count[hand[r].face]++; } int val, flag=0; Scan the array count and if any element value is 2, then a pair exists. Display the pair. The variable twoPair is used to check if there are two pairs. // if a pair exists, print it for ( pair = 0; pair < 13; pair++ ) { if ( count[ pair ] == 2 ) { twoPair++; if (pair==0) val=13; else val= pair; flag=1; } } If there are two pairs, return a bigger number than any face index. if ( twoPair == 2 ) { return 14; } if (flag!=0) return val; else return 0; } The function threeOfAKind finds a three of a kind in the hand if any. // function threeOfAKind int Card::threeOfAKind( vector<Card> & hand)

18 more pages in the full document

Unlock it once and it stays in your library, ready to chat with or turn into flashcards.

Unlock the full document
See all

Study this document with CramX

Once it is in your library, every tool can work from it.