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

Project focusing on object-oriented programming in game development.

Benjamin Fisher
Contributor
4.6
52
5 months ago
Preview (9 of 27 Pages)
100%
Purchase to unlock

Page 1

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 1 preview image

Loading page image...

Development of a Poker Game Application Using Object-OrientedProgramming TechniquesBased on the detailed description provided for a card game application, answer thefollowing:1.Explain the work plan process and its significance in project management.How does theGanttchart helpinminimizing idle time during projectexecution?2.Discuss the Agile software development methodology and its advantages anddisadvantages. How does Agile apply to game development, particularly in thecontext of a card game application? Mention the different Agile approachesand the key elements of the Agile process.3.Provideadetaileddescriptionoftheprogramplanforapokergameapplication. What are the main tasks involved, and how does the program usethe Card and DeckOfCards classes to implement the game logic?4.Describe the process of incremental development in the context of building acard 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 andDeckOfCards classes. What roles do these classes play in the poker game, andwhat functions are associated with them?6.Write the code for the Card class in C++ that includes the necessary functionsas described in the provided code snippet. Ensure that you explain the purposeof key functions like toString(), rearrange(), and replace().Word Count Requirement: Your answer should be no less than 1500 words.

Page 2

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 2 preview image

Loading page image...

Page 3

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 3 preview image

Loading page image...

Task 1:Work plan is the process in which planning for the work is done. Work plan is asystemized order of the work activities to be done. These sorts of projects areuncertain that is the time required for completion is not so clear. It is under theprobabilistic approach.Gantt chartshows 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 torepresent the work plan of the projects.Gantt chart is used to represent the activitieswith the idle time in between these activities. Gantt chart for the work plan for theapplication developed in last week is shown below:Task 2:TosimplifytheprocessAgilesoftwaredevelopment.Agiledevelopedisamethodology used to stream lined the SDLC. It is technique used for the face to facecommunication.The Systems Development Life Cycle (SDLC) refers to the end toend process of designing, building and delivering an Information System (IS) that willmeet the requirements of the business processes. SDLC is divided into four mainphases, these four phases consists of several steps which makes use of manytechniques to complete the steps and thus produce deliverables that are provided tothe customer.Approaches to agile development:Extreme programming.Dynamic system development method.Scrum technique.

Page 4

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 4 preview image

Loading page image...

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 preventthose issues.3.Design: in this phase the tested and the coded components are designed.4.Documentation:thisisanimportantelement.Inthisthecomponentsredocumented for the purpose of the implementation.There are various advantages of agile development. Some of theadvantagesof agiledevelopment are as given below:This process involves the simple and iterative application development inwhichtheeveryiterationincludesthetesting,coding,designanddocumentation.Here the iteration cycles are kept short and a development team performs itsrequirement to implement the system successfully.This will remove the unnecessary steps like quality testing, beta testing.Theagiledevelopmenthasvarious issues associated with it. Some of theissueswithagiledevelopmentare 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 facecommunication is preferred.The game development is selected by me. The steps and all tasks to show theworking of card game application are described below:Task1:A serious game isthegame with reason;thiswas not produced to be exclusivelyentertainment. It has all the essentials of an actual game, will appear and sense like aactual game, but has a number of defined reason, result or meaning the creator wish toobtain crosswise to you.Thepositiveimpacts of serious game are as given below:Better visual abilities.New method of learning.Thenegativeimpacts of serious game are as given below:The behavior of player becomes aggressive.Engage players from other activities.

Page 5

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 5 preview image

Loading page image...

An environmental gameis game like advance to aesthetics and usability, slightly thanthe adding of game rudiments. Someone can alsoname it good-natured design. Apleasant example of this is the stop working monster from Twitter. Rather than auninteresting old mistake when twitter is in excess of capacity, they have the stopworking Whale. This easy adapt in thoughts has spawn its own living, with publicrecreating the picture with dissimilar characters and still shapedt-shirts with it on.There are better examples, where game thinking has made user interfaces easier touse, but this is nice and simple.Thepositiveimpacts of environmental game are asgiven below:Provide learning environment to the players and children.Best utilization of time because player can learn thing while playing.Thenegativeimpacts 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:Theincrementaldevelopmenttechniquehelpsdeveloptheprograminsmallincremental steps. We begin with an outline program and add code in steps tocomplete each task. At each step, first we design, then code, and finally test theprogram before progressing to the next step. This enables focus on a single programtask at a time reducing the chance of errors in the program.Task3:Program Plan:Definethe classesCardandDeckOfCards.In main,deal a five-card poker hand.Define functions that check whether the hand contains two pairs, three of akind, 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-evaluatedealers hand.Display result.Task4:Problem Statement:

Page 6

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 6 preview image

Loading page image...

This application makes use of two classes namedcardandDeckOfCardsto dealfive hands of the poker game. On the bases of the quality of cards, the cards arereplaced and result is displayed to the end user.Task5:Program Tasks:We can outline basic tasks required to accomplish the objective of the program. Thesetasks are described below:Prompt user to input thecards.Prompt user toreplace the cards.Displaythe dealer hands.Task6:Design Document(ClassDescriptions):The design document of the program describes the classes that we use in the program.This also includes the local scope diagram containing themain()method. Thedesign document is illustrated in the table below:Design DocumentS. No.ClassDescription1.CardThisclass of the programis used to show thecardstotheenduser.Itcontainsvariousfunctions for operations.2.DeckOfCardsFind a random number between 0 and 51 andswap the card at that location with the currentlocation.Task7: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 ascards.Step 2: Toextract the number of cards input by user.Step 3:Shows the message that whose hand is better.Step 4: Merge above codes and display theoutput.

Page 7

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 7 preview image

Loading page image...

Task8:The code for the game of poker with its classes and various functions is as givenbelow:Cards class://Class header file: Card.h//Class members declaration#ifndefCARD_H#defineCARD_H//Header files#include<iostream>#include<vector>usingnamespacestd;Declare the data membersfaceandsuit. Declare two string arrayssuitsandfaces.Declare the constructor function and the function prototype fortoString.//Class declarationclassCard{public:// default constructorCard();// constructor Card initiliazes the data membersCard(int,int);string toString( Card& );intpair( vector<Card>&);intthreeOfAKind( vector<Card>&);intfourOfAKind( vector<Card>&);intstraightHand( vector<Card>&);intflushHand( vector<Card>&);voidcompare(vector<Card>& , vector<Card> &);voidrearrange(vector<Card>&,intc,intp);voidrearrangeAce(vector<Card>&);voidreplace(vector<Card>&, vector<Card>&,intn);voidsort(vector<Card>&);voidplayer(vector<Card>&);private:// data members declarationintface;intsuit;staticstring suits[];staticstring faces[];

Page 8

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 8 preview image

Loading page image...

};// end class Package#endif// CARD_HCard.cppfile://Member-function definitions of class Card.#include"Card.h"#include"DeckOfCards.h"usingnamespacestd;//static member declarationstring 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(){}Cardcard;Constructor:The constructor function initializes the data members.//constructor initiliazes data membersCard::Card(intcsuit,intcface){face = cface;suit = csuit;}//end Card constructorThe functiontoStringreturns the face of the card as a string.//function toStringstring Card::toString( Card& c ){return(faces[c.face]+" of "+suits[c.suit]);}//end function toStringThe functionpairfinds a pair in the hand if any.Pair function://function pairintCard::pair( vector<Card>&hand){

Page 9

Development of a Poker Game Application Using Object-Oriented Programming Techniques - Page 9 preview image

Loading page image...

// array to recordthe number of cards of each rankin the handintcount[ 13 ] = { 0 };intr=0, twoPair = 0, pair=0;The array hand contains objects ofCard. To access the face of eachCardobject usehand[r].face.// find out the number of cards of each rank in thehandfor( r = 0; r < 5; r++ ){count[hand[r].face]++;}intval, 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 itfor( pair = 0; pair < 13; pair++ ){if( count[ pair ] == 2 ){twoPair++;if(pair==0)val=13;elseval= pair;flag=1;}}If there are two pairs,return a bigger number than any face index.if( twoPair == 2 ){return14;}if(flag!=0)returnval;elsereturn0;}The functionthreeOfAKindfinds a three of a kind in the hand if any.//function threeOfAKindintCard::threeOfAKind(vector<Card>&hand)
Preview Mode

This document has 27 pages. Sign in to access the full document!

Study Now!

XY-Copilot AI
Unlimited Access
Secure Payment
Instant Access
24/7 Support
Document Chat

Document Details

Related Documents

View all