# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

3 Pages

### Lab8

Course: CECS 174, Spring 2008
School: CSU Long Beach
Rating:

Word Count: 767

#### Document Preview

174 CECS Project 8 - Due in lab on Tuesday, 12/9/03 Card games have been very popular applications to program. In this project you will continue your implementation of a very important part of the poker game. Specifically, in his project you will add to the program that you have done in Project 7 and determine what kind of a hand the input 5-card poker hand is, based on the definition given below. Poker Hand 1....

Register Now

#### Unformatted Document Excerpt

Coursehero >> California >> CSU Long Beach >> CECS 174

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
174 CECS Project 8 - Due in lab on Tuesday, 12/9/03 Card games have been very popular applications to program. In this project you will continue your implementation of a very important part of the poker game. Specifically, in his project you will add to the program that you have done in Project 7 and determine what kind of a hand the input 5-card poker hand is, based on the definition given below. Poker Hand 1. Royal flush 2. Straight flush 3. Four of a kind 4. Full house 5. Flush 6. Straight 7. Three of a kind 8. Two pairs 9. One pair 10. Nothing Definition 10, J, Q, K, A all in the same suit. A straight all in the same suit that is not a royal flush. Four cards in the hand have the same face value. For example, 4 Threes and a Nine. Three cards of one face value and 2 cards of another face value. For example, 3 Jacks and 2 Eights. Five cards all in the same suit, but not a royal or straight flush. A straight that is not a royal or straight flush. Three cards of one face value, a 4th card of a second value, and a 5th card of a third value. Two cards of one face value, 2 more cards of a second value, and the remaining card a third value. Two cards of one face value, but not classified above. For example, 2 Kings, a Jack, a Nine, and a Six. None of the above. A poker hand consists of 5 cards which may be one of 10 possible poker hands as defined below. A deck of cards has 4 suits (Spade, Heart, Diamond, and Club) and each suit has 13 possible face values (Ace, Two, Three, ..., Jack, Queen, and King). There are many ways that the face and suit values of a card may be represented. For this program, we shall use a pair of numeric values to represent a card (1 through 13 for the face value and 1 through 4 for the suit). Your program should prompt the user to enter 5 cards using 5 pairs of numeric values in the specified ranges, and then determine and output the kind of hand that the user input. Recall in Project 7, your program would have read in a 5 cards, record them in a 2-dimensional array and construct a row sums array and a column sums array. In this program you shall use these arrays to determine the kind of poker hand the 5 cards represent. When your program executes, it should produce output as in the following sample dialogue: Please enter a hand of 5 cards, using a pair of numbers for each card as follows: First enter 1, 2,..., 11, 12, or 13, for Ace, Two,..., Jack, Queen, King, respectively, enter then 1, 2, 3, or 4 for Spade, Heart, Diamond, Club, respectively. For example, enter 12 2 for a Queen of Hearts. 10 2 10 4 10 3 6 4 6 1 A Spades Hearts Diamonds Clubs Col Sum 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 5 0 0 0 0 0 6 1 0 0 1 2 7 0 0 0 0 0 8 0 0 0 0 0 9 10 0 0 0 0 0 0 1 1 1 3 J 0 0 0 0 0 Q 0 0 0 0 0 K 0 0 0 0 0 Row Sum 1 1 1 2 The input hand is a full house. _________________________________________________________________________________________ _ New features needed in Projects 7 & 8: Declare and use a 2-dimensional array. Pass a 2-dimensional array as a parameter in function call. You will again need to use 1-dimensional arrays and pass them as parameters. Use switch and break statements. _________________________________________________________________________________________ _ Requirements and recommendations: Perform the input in a function, and use a 2-dimensional array to record the input hand of 5 cards. Write a function for each of possible hands (except that for "Nothing") in the above definitions. Note that some functions may call other functions (e.g., the function that tests if a hand is a straight flush may call the function for straight and the function for flush, and the function that tests if a hand is a full house may call the function for three-of-a-kind and a pair.) Work with ONE function at a time. Use stubs for all other functions that have yet to be ...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

CSU Long Beach - CECS - 526
CECS 526 Exercise ProblemsI. Process Deadlock (Problems 1-9 are selected from Chapter 3 of Advanced Concepts in Operating Systems bySinghal and Shivaratri.)1. Give an example of a general resource graph that cannot be completely reduced, but whic
CSU Long Beach - CECS - 570
CECS 570REVIEW TOPICS FOR MIDTERMThe midterm is scheduled for Wednesday, April 16, 2008. The midterm is an open-book and open-notes exam, and will cover the following materials: Chapter 1: Parallel computers Motivation for parallel computing De
CSU Long Beach - CECS - 228
DISCRETE MATHEMATICS AND ITS APPLICATIONS by Kenneth H. RosenChapter 4 - Counting Enumeration, the counting of objects with certain properties, is an important concept involved in solving a large number of problems. For example, counting is used to
CSU Long Beach - CECS - 424
CECS 424 Lab on 9/27/05Do the following: 1. Start SML for ML programming. 2. Learn to program with anonymous functions and higher order functions in ML. Type each of the following lines and see what happens: a) Anonymous functions i) Note ML's respo
CSU Long Beach - CECS - 282
1 2Object-Oriented Programming: Inheritance1 2008 Pearson Education, Inc. All rights reserved.2Say not you know another entirely, till you have divided an inheritance with him.- Johann Kasper LavaterThis method is to define as the number
CSU Long Beach - CECS - 274
CHAPTER 4 - PART A POINTERS AND DYNAMIC DATA STRUCTURESProblem: What if we don't know ahead of time (at compile time) the amount of variable space we will need? If we under-estimate an array size, we'll get a runtime error. If we over-estimate an ar
CSU Long Beach - CECS - 474
Computer Networks and Internets, 5e By Douglas E. Comer Chapter 5 Overview of Data CommunicationsModified from the lecture slides of Lami Kaya (LKaya@ieee.org) for use CECS 474 (Spring 2009) 2009 Pearson Education Inc., Upper Saddle River, NJ. All
CSU Long Beach - CECS - 474
Computer Networks and Internets, 5e Chapter 13 Local Area Networks: Packets, Frames, and TopologiesBy Douglas Comer Modified from the lecture slides of Lami Kaya (LKaya@ieee.org) for use CECS 474, Spring 2009 2009 Pearson Education Inc., Upper Sadd
San Jose State - CMPE - 226
CmpE 226Database Design Problem Statement RequirementsFall 20071. Design a database with at least 10-12 constraint tables. The constraint tables should use the full power of linear constraints. (For example, the equality constraint x =1 does no
San Jose State - CMPE - 226
Essay Filename Format Here is the file format: FInitialLastName-CmpE226-Essay-v#-mmddyy.doc Where FlastName = FistIntial Last Name, such as for Joe Yu use JYu v# = Version number odd numbers are yours and even numbers are mine. mmddyy = month day ye
San Jose State - CS - 157
Midterm 3 Revision and ID3Prof. Sin-Min LeeArmstrong's Axioms We can find F+ by applying Armstrong's Axioms: if , then (reflexivity) if , then (augmentation) if , and , then (transitivity) These rules are sound (genera
San Jose State - CS - 157
Data Mining-Knowledge Presentation-ID3 algorithmProf. Sin-Min Lee Department of Computer ScienceData Mining TasksPredicting onto new data by using rules or patterns and behaviors Classification EstimationUnderstanding the groupings, trends, a
San Jose State - CS - 157
Huffman Trees and ID3Prof. Sin-Min Lee Department of Computer ScienceHuffman coding is an algorithm used for lossless data compression developed by David A. Huffman as a PhD student at MIT in 1952, and published in A Method for the Constructi
San Jose State - METR - 112
MET 112 Global Climate Change - Lecture 2: Energy BalanceProfessor Menglin Jin San Jose State University, Department of MeteorologyEnergy of EarthUnits Our class will use both English and Metric unit systems. Most important: Distance (kilomet
MD University College - ASIA - 2088
UNIVERSITY OF MARYLAND UNIVERSITY COLLEGEPSYCHOLOGY 301 BIOLOGICAL BASIS OF BEHAVIORAn introduction to the anatomical structures and physiological processes that determine behavior. Topics include the acquisition and processing of sensory informat
MD University College - ASIA - 2092
* THIS DOCUMENT IS NOT THE COURSE SYLLABUS * * THE COURSE SYLLABUS IS FORTHCOMMING * * * USE THIS DOCUMENT FOR REFERENCE ONLY * UMUC Asia - Yokota Air Base - 2009 Spring - Session 1 Course: PSYC 310 A340 Course Title: Perception C Class Date: 20 Jan
CSU Long Beach - K - 7145
CSULB Departmental Copier Program Instructions to Scan to an Existing E-Mail Address on the Konica 7145 CopierIf required, enter a password to activate the copier. Position your originals face up on the document feeder or face down on the document g
CSU Long Beach - KC - 350
CSULB Departmental Copier Program Instructions to Scan to an Existing E-Mail Address on the Konica c350 CopierScan to E-Mail is useful for scanning less than 10 pages at a time. To start, press Scan on the keypad. If required, enter a password to ac
CSU Long Beach - K - 420
CSULB Departmental Copier Program Instructions to Scan to an Existing E-Mail on the Konica 420 CopierScan to E-Mail is useful for scanning less than 10 pages at a time, depending on the resolution that is chosen. If required, enter a password to act
CSU Long Beach - KC - 450
CSULB Departmental Copier Program Instructions to Scan to an Existing E-Mail Address on the Konica c450 CopierScan to E-Mail is useful for scanning less than 10 pages at a time, depending on the resolution that is chosen. If required, enter a passwo
CSU Long Beach - K - 420
CSULB Departmental Copier Program Instructions to Copy Transparencies on the Konica 420 CopierIf required, enter a password to activate the copier. Position your originals face up on the document feeder or face down on the document glass. Open the b
Texas El Paso - CS - 5382
# \$Id: ocl2.txt,v 1.8 2009/03/03 17:20:02 cheon Exp \$02/20/2009 TuesdayTypes in OCL Predefined types (as defined in standard library) Basic types: Integer, Real, String, Boolean Collection types: Set, OrderedSet, Bag, Sequence User-de
USC - CSCI - 351
#!/usr/usc/bin/perl## # mailform.cgi v1.4## Feel free to use mailform.cgi as long as you include these comments## # Written by Todd Kuebler: kuebler@scn.org## 1.0 One late night..## 1.1 Now I close sendmail after I am done with it. Duh.#
USC - CSCI - 351
Reference LinkThe left-hand-side paragraph is extracted from Wikipedia. If you are interested in the whole artcile, please go to Wikipedia. (Link: http:/en.wikipedia.org/wiki/Software_design)
USC - HW - 351
Reference LinkThe left-hand-side paragraph is extracted from Wikipedia. If you are interested in the whole artcile, please go to Wikipedia. (Link: http:/en.wikipedia.org/wiki/Software_design)
Carnegie Mellon - CS - 20030523
LOGFILE_FORMAT_VERSION: 1.0SESSION_ID: Default:BEGIN_UTT (-01)[Timestamp (-01): read:GAL_REPLY_MSG_TYPE Builtin(&lt;Builtin&gt;:-1) 133 new_session at 23:50:45.05 on 23-MAY-2003][Timestamp (-01): send:GAL_MESSAGE_MSG_TYPE sphinx(localhost:11000) 1
Carnegie Mellon - CS - 20030707
LOGFILE_FORMAT_VERSION: 1.0SESSION_ID: Default:BEGIN_UTT (-01)[Timestamp (-01): read:GAL_REPLY_MSG_TYPE Builtin(&lt;Builtin&gt;:-1) 155 new_session at 18:29:10.32 on 07-JUL-2003][Timestamp (-01): send:GAL_MESSAGE_MSG_TYPE sphinx(localhost:11000) 1
Carnegie Mellon - CS - 20030605
LOGFILE_FORMAT_VERSION: 1.0SESSION_ID: Default:BEGIN_UTT (-01)[Timestamp (-01): read:GAL_REPLY_MSG_TYPE Builtin(&lt;Builtin&gt;:-1) 121 new_session at 15:06:50.42 on 05-JUN-2003][Timestamp (-01): send:GAL_MESSAGE_MSG_TYPE sphinx(localhost:11000) 1
Berkeley - I - 202
Lecture 05: Metadata: IntroductionSIMS 202: Information Organization and RetrievalProf. Ray Larson &amp; Prof. Marc Davis UC Berkeley SIMS Tuesday and Thursday 10:30 am - 12:00 am Fall 2002IS 202 - Fall 2002 2002.09.10 - SLIDE 1Lecture Contents Re
Boise State - ENGLISH - 202
Boise State - ENGLISH - 405
Allan Hancock College - SIAR - 20061
[pic] Superannuation Industry (Supervision) Amendment Regulations 2006 (No. 1)1 Select Legislative Instrument 2006 No. 189 I, PHILIP MICHAEL JEFFERY, Governor-General of the Commonwealth of Australia, acting with the advice o
N. Arizona - EDL - 789
Chapter 6: Power and Politics in SchoolsOutline Prepared by: Chris Ahearn, Mary Jo Conery, Keith Greer, Linda Griffin, Cliff Moon, and Ann Zeches POWER is the ability to get others to do what you want them to do. AUTHORITY is the probability that c
N. Arizona - EDL - 789
Howard Gardner, Multiple Intelligences Retrieved August 22, 2002, from www.thomasarmstrong.com/multiple_intellingencs.htm retrieved The theory of multiple intelligences was developed in1983 by Dr. Howard Gardner, professor of education at Harvard. It
N. Arizona - EDL - 789
Max Weber: His Life and His TheoriesJohn Campbell Northern Arizona UniversityEDL 778: Advanced Leadership Theory Dr. William Wright, Dr. Walter Delecki, and Dr. Gary Emanuel July 26, 2003Max Weber Abstract This paper summarizes Max Weber's life
N. Arizona - EDL - 789
David Snyder 7/28/03 EDL 788 Egon G. Guba Ph. D. Egon Guba Ph. D., though originally widely known for his research with Jacob Getzels regarding social systems, role conflict, and administrative theory, has enjoyed a lengthy academic career that has b
Boise State - EDTECH - 202
Presidents of the United States of AmericaThis lesson is designed to practice common features of an Access database. You will use sorts and filters to find answers to questions and make conclusions. Pay particular attention to the format of the
N. Arizona - BIO - 4262006
4. Salinity stressTwo kinds of problems due to high soil salinity1. Osmotic stress 2. Specific ion effects of high [Na+], [Cl], [SO42] inactivate enzymes, inhibit protein synth.Plant Strategies1. Osmotic adjustment to allow water uptake use ino
Carnegie Mellon - V - 602
Package: Name: Summary: Version: Description:areas/expert/systems/clips/fzclips/v602a/FuzzyCLIPS Version 6.02A 6.02a (30-SEP-94)FuzzyCLIPS 6.02a is a version of the CLIPS rule-based expert system shell with extensions for representing and manip
N. Arizona - NS - 362
0 -2 0 -2 3 4 2 6 6 7 0 19 6 7 0 19 3 4 2 6 0 -2 0 -2 6 7 0 19 0 0.5 2 -3.5 0 -2 0 -2 6 7 0 19 0 -2 0 -2 0 0.5 2 -3.5 6 7 0 19 0 -2 0 -2 0 0 2 -4 6 7 0 19 0 -2 0 -2 0 0 2 -4 6 7 0 19 0 -2 0 -2 0 0 2 -4
N. Arizona - BIO - 181
BIO 181: Unity of Life Study Guide for Chapter 9 1. Which of the following is true of mitosis? A. The chromosome number in the resulting cells is halved. B. DNA replication is completed in prophase C. Crossing over occurs during prophase D. Two genet
N. Arizona - BIO - 181
BIO 181 Review for Exam I Atomic number Atomic mass Charges and function of neutrons, electrons and protons What is an ion? Know the different types of bonding where and how they occur covalent, peptide, phosphodiester, glycosidic, hydrogen, ionic,
Boise State - EE - 436
TopicssThe logic design process.FPGA-Based System DesignCopyright 2004 Prentice Hall PTRCombinational logic networksFunctionality. s Other requirements:s Primary inputs Combinational logic Primary outputs Size. Power. Performance.FP
N. Arizona - EGR - 486
2001 E. Dortha Ave. Apt D Flagstaff, Az 86004Phone (520) 773-1420 E-mail rwl2@dana.ucc.nau.eduRoland W. LeeObjectiveTo obtain an internship that will provide experience and knowledge to grow professionally. Applications: Word, Excel, Access, O
N. Arizona - D - 486
2001 E. Dortha Ave. Apt D Flagstaff, Az 86004Phone (520) 773-1420 E-mail rwl2@dana.ucc.nau.eduRoland W. LeeObjectiveTo obtain an internship that will provide experience and knowledge to grow professionally. Applications: Word, Excel, Access, O
N. Arizona - EGR - 486
Automatic Target Recognition Requirements DocumentTable of Contents 1. Introduction to Automatic Target Recognition.1 2. Problem Statement.1 2.1. Background.1 2.2. Importance to Client.1 2.3. Value of Solution..2 2.4. Competition.2 2.5. Market Deman
N. Arizona - D - 486
Automatic Target Recognition Requirements DocumentTable of Contents 1. Introduction to Automatic Target Recognition.1 2. Problem Statement.1 2.1. Background.1 2.2. Importance to Client.1 2.3. Value of Solution..2 2.4. Competition.2 2.5. Market Deman
N. Arizona - D - 486
Heimdalls Eyes Team Standards Table of Contents 1. Role Descriptions and Assignments . 1 1.1 Team Leader .. 1 1.2 Sponsor Communications . 1 1.3 Recorder .. 1 1.4 Facilitator . 1 1.5 Documentation Coordinator .. 1 1.6 Webmaster . 1 2. Meeting Times a
N. Arizona - D - 486
Charlie Francis, Jr.30251 S. Family Housing Flagstaff, AZ 86001 Home (928) 5237957 Cell (928) 8561407 cf9@dana.ucc.nau.eduObjective EducationAn entrylevel electrical engineering position. Bachelor of Science, Electrical Engineering Norther
N. Arizona - FOR - 479
Global land-use change and energy balanceTropical deforestation, urbanization, and agricultural extensification are globally significant sources of land-use and land-cover change. How might these changes alter energy balance, and are they large enou
Boise State - EDTECH - 573
Music Copyright Scavenger HuntThis exercise is designed for the students of Mt. Harrison High School grades 10 to 12 enrolled in Business Law for the purpose of gaining an understanding of music copyright laws. Many students download music from the
N. Arizona - FIN - 311
Chapter 8Capital Budgeting Cash FlowsCopyright 2009 Pearson Prentice Hall. All rights reserved.Learning Goals1. Motives for capital outlays and steps in the capital budgeting process. 2. Basic capital budgeting terminology. 3. Relevant cash fl
N. Arizona - CIS - 310
Arithmetic Operations and Group Functions in SQL SelectsNorthern Arizona University College of BusinessArithmetic OperationsArithmetic operations can be a part of the SQL statement similar to any programming language. Arithmetic operators include
N. Arizona - CIS - 310
0Normalization Rules for Database TablesNorthern Arizona University College of Business Administration0Normalization - Some Definitions a relation is a two-dimensional array with a single-valued entry in each cell which has no duplicate rows
N. Arizona - CIS - 220
6Repeating InstructionsC# Programming: From Problem Analysis to Program DesignC# Programming: From Problem Analysis to Program Design1Chapter Objectives Learn why programs use loops Write counter-, state-, and sentinel-controlled while lo
N. Arizona - CIS - 220
7Arrays and CollectionsC# Programming: From Problem Analysis to Program DesignC# Programming: From Problem Analysis to Program Design1Sentinel-Controlled Access What if you do not know the number of elements you need to store? Could ask u
N. Arizona - CIS - 310
CIS 310 Hands on Lab 6 (15 points possible) Due Mar. 9 Open a SQL*Plus session on oracba, open a notepad file and build and execute the commands described below. Submit via e-mail to james.morgan@nau.edu a listing of your commands plus brief response
N. Arizona - CIS - 310
B-Tree and Hashing Homework (due March 12 - 10 points possible) (answer the questions indicated. For question 2 show the changes on the diagram - use pencil)
N. Arizona - FIN - 331
Fin 331, Chapter 6 Portfolio Risk/ReturnIf we have a sample of returns for a portfolio we can calculate the average return the same way we do for a single asset. _ Av ret = rp = (r1 + r2 + . + rn)/ n And the standard deviation of returns from a samp
N. Arizona - FIN - 311
Finance 311, Problem Set #2 Name_1. Preferred stock pays an annual dividend of \$10 per share. (a) What is the stock worth if the required rate of return is 10%?(b) What is the rate of return on the stock if the price is \$120?2. (a) XYZ
N. Arizona - BA - 490
Fall 2006 BPG Firm Responsibilities Updated 12/5/2006 10:00:00 AM Team CEO CFO VP Production World 1 1-1 1-2 1-3 1-4 1-5 Brent Kellyn Mike Gidell Damien Plunkett Eric Harris David Edwards Vickie Wuest CJ Allen Mike Rubin Brent Keesler Emily Roy M