CS 230 Fall 2009                                                Assignment 5 –Random Number Generation and MultiWay Branching                                           

100 points

 

Assigned: 10/06/2009

Due: 10/12/2009 at the start of class

 

Pre-Lab (Do Before Lab):  Bring materials – a way to save a copy for you and a copy to turn in. Plan out tasks, objects, and events needed for program.  Think about the main button’s pseudocode / flow chart.

 

Main Assignment:

The Food! Casino offers pseudo-slot machines in which the machine displays one of the following 5 images:

·         Pizza – wins and pays 1.5 to 1 (or 3:2) if you prefer

·         Choc chip cookies – wins and pays even money

·         Coffee – loses

·         Cake – loses

·         Deli sandwich – loses

 The Casino has asked you to develop a program to produce a video version. You will need to get from the user the amount bet. You will then randomly generate one of the five images to display, and adjust the player’s current stake (amount of money).  As a simplifying assumption, all gamblers start with $100.00 of money. In addition to the betting capability, provide capabilities to reset (sets amount of money back to $100 and clears the bet text box) to start again, and to exit.

Please set the name of the project to something other than the default name (WindowsApplication1, …). It is helpful if you use a name that identifies you as well as the assignment (e.g. yourlastname assignment 5).

Background Knowledge:

Task Details:

slotPictureBox.Image = pizzaPictureBox.Image       (if those are the names you used)

Miscellaneous:

Hand in: