CS 230 Spring 2007

Assignment 1 –Simple GUI  

100 points

 

Assigned: 01/24/2007

Due: 01/31/2007 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.

 

Main Assignment:

Casinos are coming to the Philadelphia area! Imagine that you are writing the beginnings of a very basic program for a dice game.  The user will enter into a textbox how much money they have to start. When a “Roll” button is Clicked, roll two die (info below) and display their values in textboxes.  Also, display their total in another textbox and turn the background color of that textbox red.  Since we haven’t covered branching yet, we’ll use a very simple rule – “The house always wins; the customer always loses” – subtract $0.05 from their money total each time they “play” and display a message box telling the user that they lose.  Also provide “Clear” and “Exit” buttons.  The Clear button should clear the 3 dice textboxes, and set the background color total textbox to light gray. The Exit button should exit the application.    

 

Hand in:

 

Task Details:

o        Dim randGen As New Random   ‘ randGen can be any name you choose
        And then, each time you want to roll a die
o        variableNameThatYouChoose = randGen.Next(1, 7) ‘ 1 is the minimum, 7 is 1 above the max

 

Miscellaneous:

·         You must turn on Option Strict and Option Explicit

·         Put YOUR NAME, e-mail address, date, and purpose of the program in comments at the beginning of the program. The purpose should be what the program is supposed to do, not the learning goals. Comments are indicated with a single quote (everything after the single quote is only for humans)

·         You MUST include comments that explain your program in order to get full credit.

·         Name all textboxes and buttons meaningfully, and use conventions for starting their names.

·         Make textboxes that user should never enter a value in “Read Only”

·         Remember to use meaningful variable names, and indent to show the structure of the program (VB usually does this correctly).

·         Put your name on the form as a Label or as part of the form title.

·         Try to use good user interface design. Make clear what user needs to do and what the answers mean.