Write a function to determine if the hand contains a pair

Assignment Help Computer Engineering
Reference no: EM131951904

Programming Assignment: Poker (5-Card Draw)

I. Learner Objectives:

At the conclusion of this programming assignment, participants should be able to:

* Declare and define arrays of pointers to strings

* Manipulate 2-Dimensional arrays

* Apply triply nested loops

* Manipulate strings

II. Prerequisites:

Before starting this programming assignment, participants should be able to:

* Apply and implement pointers in C

* Pass output parameters to functions

* Analyze a basic set of requirements and apply top-down design principles for a problem

* Apply repetition structures within an algorithm

* Construct while (), for (), or do-while () loops in C

* Compose C programs consisting of sequential, conditional, and iterative statements

* Eliminate redundancy within a program by applying loops and functions

* Create structure charts for a given problem

* Open and close files

* Read, write to, and update files

* Manipulate file handles

* Apply standard library functions: fopen (), fclose (), fscanf (), and fprintf ()

* Apply and implement pointers 2-dimenional arrays

* Define and apply structs in C

* Compose decision statements ("if" conditional statements)

* Create and utilize compound conditions

* Summarize topics from Hanly & Koffman Chapter 8 including:

* What is an array?

* Distinguishing between single dimensional and 2-dimentional arrays

* What is an index?

III. Overview & Requirements:

Write a program that allows a user to play 5-Card-Draw Poker against the computer.

Start with the following example code supplied by Deitel & Deitel (example code). This will help you get started with the game of Poker. Please read this site to learn the rules of Poker. Complete the following step and you will have a working Poker game!!!

Adapted from Deitel & Deitel's C How to Program (6th Edition):

(1) In order to complete the game of 5-card-draw poker, you should complete the following functions:

(a) Modify the card dealing function provided in the example code so that a five-card poker hand is dealt.

(b) Write a function to determine if the hand contains a pair.

(c) Write a function to determine if the hand contains two pairs.

(d) Write a function to determine if the hand contains three of a kind (e.g. three jacks).

(e) Write a function to determine if the hand contains four of a kind (e.g. four aces).

(f) Write a function to determine if the hand contains a flush (i.e. all five cards of the same suit).

(g) Write a function to determine if the hand contains a straight (i.e. five cards of consecutive face values).

(2) Use the functions developed in (1) to deal two five-card poker hands, evaluate each hand, and determine which is the better hand.

(3) Simulate the dealer. The dealer's five-card hand is dealt "face down" so the player cannot see it. The program should then evaluate the dealer's hand, and based on the quality of the hand, the dealer should draw one, two, or three more cards to replace the corresponding number of unneeded cards in the original hand. The program should then re-evaluate the dealer's hand.

(4) Make the program handle the dealer's five-card hand automatically. The player should be allowed to decide which cards of the player's hand to replace. The program should then evaluate both hands and determine who wins. Now use the program to play 10 games against the computer. You should be able to test and modify or refine your Poker game based on these results!

You may make any adjustments or customizations to your Poker game that you wish!

Reference no: EM131951904

Questions Cloud

Effective choices regarding health plans : How can health "report cards" (like those compiled by the State of California's Office of the Patient Advocate) help consumers make effective
Calculate the companys weighted average cost of capital : Calculate the company's weighted average cost of capital. Use the dividend discount model. Show calculations in Microsoft® Word.
Analyze the internal environment of the company : Analyze the internal environment of the company you researched to determine that company's strengths and weaknesses.
What are the tools of the fed that the fed uses : What are the Tools of The FED that The FED uses? What is (define) The Discounted Rate? What is the purpose of The FED's Discounted rate?
Write a function to determine if the hand contains a pair : Write a function to determine if the hand contains a pair. Write a function to determine if the hand contains two pairs.
Determining the technology improvement : Explain how the change in technology affects the long-run price of solar panels.
Explain theory to brain development : In a five paragraph essay (600 minimum words) using your favorite theorist, apply that theory to brain development as it was discussed in our readings.
Discuss the features of ipam and how it might be useful : Discuss the features of IPAM and how it might be useful in a large organization. Create a 4- to 6-slide PowerPoint presentation on your findings.
Discuss and critically evaluate the small business : LAW5230 - discuss and critically evaluate the Small Business CGT Concession regime in Australia - You must support your discussion with reference

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd