Program 3

advertisement
CITA140 – Introduction to Programming
Name:____________________
Lab Exercise 3: Emphasis on Chapter 5
Before beginning this Lab Exercise, please close all applications and files on your computer
(including IM and Email) except for Visual Basic 2008. Having any application or file, other
than Visual Basic, open on your computer will result in a grade of zero (0) on the Lab
Exercise. You must start a new solution and project; you may not use a previously-created
solution as the basis for this solution.
You may use your textbook, the Notation Conventions document, and the Variable Naming
Conventions document while doing this Lab Exercise. Use Hungarian Notation to name all
objects. Use proper Variable Naming Conventions to name all variables.
Problem: Prof. Smith would like an application to calculate the average weights of the students in his
class. The application should allow Prof. Smith to enter the weights of as many students as
necessary. The application will calculate and display the total of these weights, the number of
students whose weights were entered, and the average student weight. Remember to check to
make sure that each weight entered is numeric data; if not, let Prof. Smith know this by
showing a message.
1) Draw a TOE chart for the above problem and write appropriate pseudocode for the event
procedures on the attached sheet.
2) Using Visual Basic 2008, create a solution. Name the solution <your last name> Weight Solution
and name the project Weight Project. Create the required form, name it appropriately, and place the
appropriate controls on the form. Arrange the controls in a manner consistent with the style
recommendations discussed in your textbook. Remember to set the properties of the controls to
make the interface user-friendly and programmer-friendly. In addition, set an access key for each
button control you create.
3) Comment your Visual Basic 2008 code as appropriate, including a comment block at the top of
the code and in-line comments as necessary. Include the appropriate Option statements in your
code.
4) Extra Credit: Check to make sure that Prof. Smith enters only positive values for weights; ignore
any negative weights entered.
5) Run the application and make sure it works correctly. Raise your hand and show me your
program. Please print you program out and hand it in.
Page 1 of 2
Version C - Fall 2014
CITA140 – Introduction to Programming
Draw TOE Chart(s) and Write Pseudocode Below:
Page 2 of 2
Version C - Fall 2014
Download