BASIC Programming

Chapter 4 Programming Assignment Part 2(Ch4Prob2)

Develop necessary programming habits by planning properly and following the proper steps of programming. You must complete your test plan and pseudocode before writing or typing actual VB code. Otherwise, we will consider you to be a "hacker". THERE IS NO PLACE FOR HACKERS IN THE WYOMISSING AREA COMPUTER SCIENCE DEPARTMENT.


Ch. 4, Problem #2

Specs

Write a program modelled somewhat on Ch4Demo1 that uses the Form_KeyPress event to allow the user to play an interesting game with the following specifications. The user begins with a score of zero. The user's goal is to obtain a score that is as high as possible by determining when to exit the game. When he/she presses an uppercase letter, one is added to his/her score, which must be displayed in a label at all times. However, one uppercase letter of the programmer's choice should cause 500 to be deducted from the user's score. When he/she presses a lowercase letter, one is subtracted from his/her score. However, one lowercase letter of the programmer's choice should cause 500 to be added to the user's score. If the user presses any other key (with ASCII values between or including 33 and 126) in error, make a warning label visible to instruct the user that he pressed the wrong kind of key. If his/her running score goes below zero at any time the game must immediately end with the user's score being zero. If his/her running score goes above a secret number of the programmer's choice, the game ends with the user's score going to zero. The user can also choose to end the game by clicking an Exit button. When the game ends, display a message box that indicates how many seconds passed since he/she began the game. Your program must follow the Documentation & Coding Standards. You will lose significant points for poor user interface, poor spacing, indentation, variable names, etc. Use appropriate decision structures (If, If/Else, If/ElseIf, or Select Case that maximizes the program's readability and efficiency.

Note this assignment is similar in a number of ways to Ch4Demo1. Please study that program and any other helpful Ch. 4 demo program for help with certain techniques that must be used in this assignment.

Save the form and project files as "Ch4Prob2" with the proper file extensions (.frm & .vbp, respectively) in a newly created folder named Ch4Prob2 within your network Basic folder. Also, save or copy this project (.frm & .vbp files) into a folder named Ch4Prob2 within your Submit folder (so that Mr. Minich can execute and test the program.)

Print out the code and the form image and staple them together with the code window on top. Type and print out your pseudocode using MS Word and save it as "Ch4Prob2Pseudocode.doc". Type and print out your test plan using MS Excel and save as "Ch4Prob2TestPlan.xls".

Staple your printouts in the following order:

  1. VB code
  2. VB form image
  3. MS Word pseudocode
  4. MS Excel test plan
  5. Interface Design Planning Sketch
  6. Objects & Properties Planning Form
  7. Event Procedures Planning Form

Pseudocode

(must be typed into MS Word although you can add or change steps)

- you will be expected to generate and type out your own, detailed pseudocode

Test Plan

(must be typed into MS Excel although you must add additional test plan cases)

 

Possible Inputs

Expected Outputs

Reason
 

user's letter

amount added to user's score

 

1.

A

+ 1

lower boundary for uppercase letters

2.

c

- 1

normal input for lowercase letter

3.

M

-500

upper case letter that deducts 500

Create as many test items as necessary!

BASIC Programming Home Page | Mr. Minich's Wyo Home Page