COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these...

9
COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form. 2. To learn how to use these events: - Click, MouseDown, and MouseUp 3. To learn how to use internal documentation 4. To learn how to place an icon into a button 5. To learn how to set properties in the Property Window. 6. To learn how to set properties in the code. 7. To learn how to exit a program using Me.Close(). “Close” is a method (a behavior). 8. To learn how to submit a program.

Transcript of COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these...

Page 1: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS

ASSIGNMENT OBJECTIVES1. To learn how to use these controls:

- buttons, labels, picture boxes, and a form.

2. To learn how to use these events:- Click, MouseDown, and MouseUp

3. To learn how to use internal documentation

4. To learn how to place an icon into a button

5. To learn how to set properties in the Property Window.

6. To learn how to set properties in the code.

7. To learn how to exit a program using Me.Close(). “Close” is a method(a behavior).

8. To learn how to submit a program.

Page 2: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS

GETTING HELP:You may ask another student for help, but you must not copy their code. Failure of the course will result for the person giving code and the person receiving code.

I can get limited help from other students. For additional help, I need to see Dr. Scanlan, his assistant, or the tutoring center.

Page 3: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

Due Date: Feb 20, 2014 (This is a VERY EASY program.)

START ASAP!20 POINTS Purpose:You are the owner of a Blockbuster Video Store and you need to set up a kiosk to help customers locate videos. The store is color-coded so thateach movie category is in a physical section of the store with different colored shelves and different colored aisle carpet.

Requirements:

NOTE: THE COMPILED PROGRAM IN ZIP FORM IS ON THE COURSE WEB SITE. DOWNLOAD AND RUN THE PROGAM TO SEE HOW IT WORKS. YOUR PROGRAM MUST WORK EXACTLY THE SAME WAY, AND IT MUST LOOK SIMILAR .

1. Create a form with seven buttons and six labels. You will need two picture objects for the Blockbuster picture. You can find this icon or picture using Google's image search. Find something very similar if you have trouble finding the exact one.

2. Six buttons have video categories displayed as text.3. The GUI must reasonably match the one on this slide.(Continued on the next slide.)

Programming Assignment 01

Button Location Aisle ColorComedy Aisle 1 BrownDrama Aisle 2 BlueAction Aisle 3 OrangeSci-Fi Aisle 4 GreenHorror Aisle 5 RedNew Releases Aisle 6 Yellow

Comedy

Aisle LocationMake a Selection

Aisle Color

Drama

Action

Sci-fi

Horror

New Releases

Necessary prerequisites1. Book Chapters 1, 22.Notes: Chapters 1, 2 3.Mouse down and up Events.4. Picture Box Properties5. In-class lectures.

In-Store Video Locator

Store’s layout

Page 4: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS

Requirements continued:6. Do not use the default names for the objects mentioned below. Use the names supplied. Use the default names for all other objects.

Button objects’ names:btnActionbtnComedybtnDramabtnHorrorbtnSci_FibtnNewReleasesbtnExit

Label objects’ names:lblDisplayAisleLocationlblDisplayAisleColor

7. Button MouseDown EVENT:1. On a MouseDown event, the pressed button turns black.2. On a MouseDown event, the text in the pressed button turns white.3. On a MouseDown event, the aisle location is displayed in lblDisplayAisleLocation.

Note: lblDisplayAisleLocation’s backcolor always stays white.4. On a MouseDown event, the aisle color is displayed in

lblDisplayAisleColor. It must be displayed in the backcolor.

8. Button MouseUp EVENT:1. On a MouseUp event, the button turns white.2. On a MouseUp event, the text in the pressed button turns

black.3. On a MouseUp event, lblDisplayAisleLocation is cleared

of its text, that is, the aisle location.4. On a MouseUp event, lblDisplayAisleColor is reset to its

original backcolor, white.

Programming Assignment 01

Button Location Aisle ColorComedy Aisle 1 BrownDrama Aisle 2 BlueAction Aisle 3 OrangeSci-Fi Aisle 4 GreenHorror Aisle 5 RedNew Releases Aisle 6 Yellow

Store’s layout

Aisle LocationMake a Selection

Aisle ColorComedy

Drama

Action

Sci-fi

Horror

New Releases

In-Store Video Locator

Use a white backcolor

Use a white backcolor

PICTURE BOX OBJECTS

MouseDown event is triggered by pressing the left mouse button down.MouseUp event is triggered by releasing the left mouse button after it has been pressed down.

Page 5: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS

Requirements continued:9. Your program must have internal documentation. See the example on the next two slides.10. This program will be accepted late, but with a 50% loss of points for each class day late.11. You must fill out and submit Form-B. See the slides at the end.

Programming Assignment 01

Page 6: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS

AN EXAMPLE OF HOW INTERNAL DOCUMENTATION MUST BE DONE.Fig 2-330

INTERNAL DOCUMENTATION EXAMPLE

PROGRAM DOCUMATION• The program must have documentation at its beginning. You MUST use this form for your programs.

SUB PROCEDURE DOCUMENTATION• Each procedure must have documentation at its

beginning. You MUST use this form for your programs. The heading must be all caps and contain no more than four words.

Page 7: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS Fig 2-350

SUB PROCEDURE DOCUMENTATION• Each procedure must have documentation at its beginning. You MUST Use this

form for your programs. The heading must be all caps and contain no more than four words.

AN EXAMPLE OF HOW INTERNAL DOCUMENTATION MUST BE DONE.

INTERNAL DOCUMENTATION EXAMPLE

Page 8: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

Form-A Form-A

Programming Assignment 01

GRADER FILLS IN THESE BLANKS:

LAST NAME:_______________________________

FIRST NAME:________________________

PROGRAM (Circle) 1 2 3 4 5 6 7 8 9

DATE DUE:_____________________

DATE SUBMITTED:___________________

GRADER FILLS IN THESE BLANKS:DESCRIPTION POINTS POSSIBLE POINTS EARNEDCorrect internal documentation: 0 OR 2 _____________Reasonably correct GUI: 0 OR 2 _____________Program runs correctly: 0 OR 14 _____________Proper style for object names: 0 OR 2 _____________

Failure to submit program correctly (See Form-B) 0 OR -5 _____________Late penalty: 50% off / day _____________

TOTAL POINTS OUT OF A POSSIBLE 20: _____________IMPORTANT: IF THE GRADER CANNOT READ THE PROGRAM OFF THE DISK ORIF THE PROGRAM FAILS TO COMPILE, AN AUTOMATIC ZERO GRADE WILLRESULT.

Spring 2014

Page 9: COPYRIGHT Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.

Form-B Form-B

STUDENT FILLS IN THESE BLANKS:

LAST NAME (PRINT) :_______________________________

FIRST NAME (PRINT):________________________

PROGRAM (Circle) 1 2 3 4 5 6 7 8DATE DUE:_________________DATE SUBMITTED:__________________

PLACE A CHECK NEXT TO THE FOLLOWING:

1. ____ Save the Program on a CD-R or DVD-R using the following folder and sub-folder: Your Name\Program 01

2. ____ Print your full name and program number on the CD-R or DVD-R using a permanent black marker.

3. ____ Sign your full name with permanent black marker on the CD or DVD.

4. ____ Submit the CD-R or DVD-R in required envelope style not much larger than the CD-R or DVD-R.

5. ____ Place the CD-R or DVD-R in the envelope.6. ____ Cut out this form along dotted edges and TAPE it to the

envelope.7. ____ Be sure a working program in on the disk and it can be read.

Zero points if PROGRAM is not on the disk or can’t be read.

If not submitted correctly 5 points will be

deducted from your score.!!

CUT OUT THIS FORM ALONG THE DOTTED EDGES AND TAPE IT TO THE ENVELOPE.

YOU MUST USE THIS STYLE THATIS ABOUT THE SIZE OF YOUR CD-Ror DVD-R.Do not lick to seal. Use metal clip.

NOTE: You may also use the self sealingtype of envelope found in the bookstore.

Program #1 Spring 2014