Creating form which analyzes poker hand entered by user

Assignment Help Programming Languages
Reference no: EM1345023

Q1) In this assignment you will need the Visual Basic language features. A convenient way to determine different poker hands is to keep track of the cards in a player's hand with a table array of rows and columns. Row 1 tracks the clubs dealt, row 2 the diamonds, row 3 the hearts, and row 4, the spades. Column 1 tracks the aces, column 2, the twos, and so on through column 10. Column 11 tracks the Jacks, column 12 the queens, and column 13 the kings. If the name of the table is "cards" then cards(i,j) is set to 1 if the player is dealt face value j in suit i; otherwise cards(i,j) is set to 0. For example, if cards(2,11) = 1 then the player holds the jack of diamonds. Row 0 and Column 0 are not used. A card is represented by a String that indicates the card's face value followed by the suit. The face value is one of the Strings : "A", "2", "3", ..., "9", "10", "J", "Q", or "K". The suit is given by one of the letters "C" (clubs), "D" (diamonds), "H" (hearts), or "S" (Spades). Thus "AH" represents the ace of hearts and "10S" the ten of spades.  A poker hand of 5 cards will be represented by a String of cards, each separated from the next by a comma. For example, the String : "aH, AS, 2D, 3C, 4C" describes a hand consisting of the ace of hearts, ace of spades, two of diamonds, three of clubs, and four of clubs. Note that spaces may occur between cards, but not between the face value and suit  of any card. The user may specify a suit or the ace in either upper or lower case.

1. For each of the following types of poker hands design a Sub procedure that will recognize the hand in the table cards and, if observed, add the corresponding phrase to the ListBox:

a. Four of a kind
b. Three of kind
c. A pair
d. A flush
e. A straight, if ace is low.
f. An ace-high straight; that is the sequence: 10, J, Q, K, A

2. To observe the behavior of your Sub Procedures, design a Form that analyzes a poker hand entered by the user and displays the type of hand as indicated in (1). Your program should include the following:

a. A TextBox for the user to type in a poker hand.

b. A ListBox to display the result of the analysis. Note that a hand may have more than one description. For example, a hand may hold a full house; that is, a pair and three of a kind. Both descriptions should be displayed. However, four of a kind should not also be described as two pair.

Reference no: EM1345023

Questions Cloud

Find the investment in capital project : Telecom Italia is considering investment in a capital project. Initial cost in year 0 is $149,000 to be depreciated straight line over five years to an expected salvage value of 15,000 dollar.
Find the current yield and yeild to maturity : Charlotte's Clothing issued a 5% bond with a maturity date of fifteen years. 5-years have passed and the bond is selling for $690.
Determine the bonds current yield and yield to maturity : A bond with fifteen years until maturity has a semiannual interest rate of $40. If the bond sells for its par value, determine the bond's current yield and yield to maturity values?
Discuss the characteristics of resort business : The estimation of Kitty (Hawk Food), Inc., a restaurant food wholesaler in eastern Carolina. The company is experiencing difficulty paying trade debt & collecting trade receivables on time,
Creating form which analyzes poker hand entered by user : To observe behavior of Sub Procedures, draw a Form which analyzes a poker hand entered by user and displays the type of hand.
Create income statement for the current month : Regal Flair Enterprises has two product lines: jewellery & women's apparel. Cost & revenue data for every product line for current month are as follows;
Explain terrorist attacks foster instability and may affect : Explain terrorist attacks foster instability and may affect productivity over the short and long term.
Evaluate the required return for an asset : Evaluate the required return for an asset with a beta of .90 when the risk-free rate and market return are 6% and 10% respectively and fine the risk-free rate for a firm with a required return of 12% and a beta of 1.25
Explain sensitivity analysis : What role does this type of analysis play in your work environment or in your home environment and also explain  sensitivity analysis.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a vhdl code for soda vending machine

Write a VHDL code that implements the above soda machine. You have to turn in the following: A state diagram showing the implementation of your design. Clearly show all the states and the conditions on which transitions occur.

  What is java adapter class

What is Java adapter class.

  Programming problem

Programming Problem can be solved by a program that performs three basic tasks-Input Data, Process Data, and Output Results.

  Computer sales and repair store system

It is required to design a relational database system for a "realistic" application

  Explaining risk in fixed-price contracts

It is recognized that fixed-price contracts offer obvious advantages to buyer organizations because they transfer almost all of the risk to the contractor.

  Program has function named presentvalue for calculations

Write a program that has a function named presentValue that performs this calculation. The function should accept the future value, annual interest rate, and number of years as arguments.

  Executive committee for alleviating it complexity

You are a consultant brought in by the executive committee to make recommendations for alleviating the "IT complexity" concerns of the executives at the company.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Computing first seven values of fibonacci number sequence

Write a program that uses a loop to compute the first seven values of the Fibonacci number sequence.

  Application development and programming languages

Application Development and Programming Languages,  Programming languages have evolved since the First Generation Languages (1GLs) in the 1940s. The 1GLs were machine languages, which interacted directly with hardware. 2GLs were assembly languages. F..

  Program to write variable declarations and function calls

Write a program whose main function is merely a collection of variable declarations and function calls. This program reads a text and outputs the letters, together with their counts.

  Two-level memory cache hierarchy

Explain how you would pipeline the four following pairs of statements.

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