UMBC CS 201, Fall 98
UMBC CMSC 201 & 201H Fall '98 CSEE | 201 | 201 F'98 | lectures | news | help

CMSC 201
Programming Project Two

201's Modified KENO

Additional sections have been added to this project description. The new sections have red headings. These modifications were made Sat., 10/10/98.

Out: Wednesday 10/7/98
Due: Midnight Wednesday 10/21/98

The Objective

The objective of this assignment is for you to become familiar with functions, random numbers, arrays and separate compilation.

The Background

The State of Maryland has a gambling game called KENO. In this project, you will simulate playing KENO, but with easier rules.

For each game of KENO, 20 numbers are chosen randomly from the range of values 1 to 80 and displayed in a grid on a screen. Four rows and five columns are used to display the 20 values. In the real KENO game, no duplicates are allowed in these values, but for our modified game, duplicates are allowed, making the code much easier to write.

In order to play KENO, the player must first decide whether he wants to try to match only 1 of the 20 numbers, or 2, or more. The number of matches you are trying to make is called the spot. So if the player wants to bet that he can match 4 of the 20 numbers, it is said that he's playing a 4 spot game. The player can choose to play a 1 spot game up to a 10 spot game.

Next the player must decide how much to wager. He can choose to bet between $ 1 and $ 20 per game. The chart shown below will show the prize value per dollar wagered.

Finally the player must choose the numbers he thinks will come up. Obviously, if the player is playing a 3 spot game, he must enter 3 numbers; 7 spot game, 7 numbers, etc. In the real KENO game, if you are playing the 3 (or more) spot game, you can win smaller prizes than those shown in the chart below for matching fewer number than the spot of the game. In our modified version, the player must match all 3 numbers to win a 3 spot game. The payouts are shown in the chart below.

KENO Payout Chart

1 spot game match 1 to win $ 2 per $ 1 bet 2 spot game match 2 to win $ 10 per $ 1 bet 3 spot game match 3 to win $ 25 per $ 1 bet 4 spot game match 4 to win $ 50 per $ 1 bet 5 spot game match 5 to win $ 300 per $ 1 bet 6 spot game match 6 to win $ 1000 per $ 1 bet 7 spot game match 7 to win $ 2500 per $ 1 bet 8 spot game match 8 to win $ 10000 per $ 1 bet 9 spot game match 9 to win $ 25000 per $ 1 bet 10 spot game match 10 to win $ 100000 per $ 1 bet

The Task

You are to write a program that simulates the playing of KENO, using the CMSC 201 modifications stated above. These modifications will make the coding of the project easier.

You'll be expected to write a minimum of ten functions, other than main, for this project.

Here are the function prototypes:

void DisplayRules (void); int GetSeedFromUser (void); int GetRandomNumber (int high, int low); int GetSpots (void); int GetWager (void); void GetPicks (int picks[10], int spots); void DrawNumbers (int numbers[4][5], int rows, int cols, int high, int low); void DisplayNumbers (int numbers[4][5], int rows, int cols); int IsWinner (int numbers[4][5], int picks[10], int rows, int cols, int spots); void DisplayWinnings (int winner, int wager, int spots);

Function Descriptions:

Additional Coding Specifications

Further Clarification

Extra Credit --- 5 points

For extra credit, you must have no duplicates among the 20 randomly chosen numbers. This must be accomplished in an efficient manor or your work will gain you no extra points. You may use any sorting or searching code that is given either on the lecture pages or in your text, just cite your source.

Sample Output

[Game description and rules go here] Please enter a number : 7 Enter how many numbers you want to play (1 - 10) :2 Make your wager in dollars (1 - 20) :1 Pick a number (1 - 80) :52 Pick a number (1 - 80) :21 45 47 69 35 52 6 35 31 66 34 14 4 31 35 30 3 26 55 31 21 You won $ 10 Enter any integer to continue playing, or -1 to end : 1 Enter how many numbers you want to play (1 - 10) :3 Make your wager in dollars (1 - 20) :10 Pick a number (1 - 80) :19 Pick a number (1 - 80) :11 Pick a number (1 - 80) :31 13 68 40 59 62 65 40 34 75 71 54 31 19 11 69 68 36 73 25 69 You won $ 250 Enter any integer to continue playing, or -1 to end : 5 Enter how many numbers you want to play (1 - 10) :5 Make your wager in dollars (1 - 20) :2 Pick a number (1 - 80) :17 Pick a number (1 - 80) :29 Pick a number (1 - 80) :49 Pick a number (1 - 80) :21 Pick a number (1 - 80) :5 56 79 29 46 47 47 47 65 11 34 18 80 14 60 34 15 67 36 21 39 You won $ 0 Enter any integer to continue playing, or -1 to end : 1 Enter how many numbers you want to play (1 - 10) :11 Invalid number - only numbers between 1 and 10 Enter how many numbers you want to play (1 - 10) :-1 Invalid number - only numbers between 1 and 10 Enter how many numbers you want to play (1 - 10) :1 Make your wager in dollars (1 - 20) :25 Invalid number - only numbers between 1 and 20 Make your wager in dollars (1 - 20) :0 Invalid number - only numbers between 1 and 20 Make your wager in dollars (1 - 20) :3 Pick a number (1 - 80) :49 78 15 22 25 5 18 17 57 59 4 45 38 1 53 45 26 11 1 5 38 You won $ 0 Enter any integer to continue playing, or -1 to end : -1 Thanks for playing KENO Hope you didn't lose your shirt !!!

Submitting the Program

To submit the file you should use the command:

submit cs201 proj2 proj2.c keno.c keno.h

You can check your submission by using the command:

submitls cs201 proj2


CSEE | 201 | 201 F'98 | lectures | news | help

Saturday, 10-Oct-1998 13:33:05 EDT