This program is not due until Thursday the 28th.
Due date
extended until Tuesday November 2nd.
See your e-mail & Blackboard.
Early
class discussion about programming assignment
Later class discussion
about programming assignment
However, you may run into some problems so you should do a bit of work before Tuesday’s class so you can get clarification on things that aren’t working the way you expected them to.
Write an
There will be no more than 10 hands but there may be less..
A hand consists of 5 cards that are to be entered 1 at a time.
Your program should expect the user to enter a rank and a suit for each card..
After each set of 5 cards is entered, the program should echo the cards and describe the hand.
You may assume that the cards are coming from a single legal deck. ( i.e. it is illegal for there to be two identical cards in a given hand)
Possible hands are:
A bust (none of the hands that follow)
One pair
Two pair
Three of a kind
A full house (three of one kind, two of another)
Four of a kind
A straight
A flush
A straight flush
REQUIRED elements
You must call your main procedure (the executable) Poker.
You must use enumerated types for the rank and the suit of each card.
You must use a record to hold the rank and suit associated with a card.
You must use an array to hold the cards belonging to a given hand.
You must use a case statement AND/OR an if … then … else AND/OR an if … then …elsif control structure
You must include exception handling for errors the user could make.
Possible errors include but are not limited to:
Incorrect input of suit name (i.e. spider instead of spade)
Duplicate card being entered
File not found (if files are used for input)
You must include the standard heading and descriptions of program purpose, input and output.
You must also include comments telling
a. what your code is doing
b. something
about the way the
Your program should tell the user what it will do and what input it expects.
Output should be labeled.
Optional elements
You may make use of a separate package of specifications
You may make use of a separate package body to evaluate the hands.
You may make each of your procedures a separate file and have your main procedure with each of them (this allows for easy separate compilation for syntax ) OR you may embed your procedures in the file with your main procedure.
You may use files to obtain your input but you need to allow the user to provide the name and path of the file to be used (see file usage in Eight Queens)
You may send your results to a file but again you need to allow the user to provide the name and path of the file to be used if your program does this.