Wyo VB Ch6Proj1
Write a program that allows the user to calculate a test average.
When the user clicks a command button, he/she is prompted with 5 consecutive
input boxes that allow him/her to enter 5 whole numbers between or including
0 and 100. Immediately after the fifth test score is inputed, the program will
display the test average rounded to the nearest tenths place in a label. In
another label, the program will display the least test score and, in a third
label, the greatest test score will be inputed. The user can click a Clear command
button to clear all three output labels. When the user is finished running the
program, he/she will click an Exit command button.
The program must use a function named sngAverage that is passed an array
of 5 integers by reference (i.e. do not use ByVal in the function header). The
function must return a single value (i.e. decimal number) that is the average
of the 5 elements of the array. The program must also use a function named sngRound
that accepts one single parameter and returns that parameter rounded to the
nearest tenths place. You are not allowed to use the built-in VB Round function
in this program. The program must also use functions named intFindMin
and intFindMax that are passed arrays of integers by reference and that
return the least or greatest values of the passed array.
Your program may not use any module-level or Static variables.
Your program must follow the Coding Standards. You could lose many points for violating the Coding Standards (e.g. poor spacing, incorrect indentation, incorrect prefixes, etc.) Save the form (frmMain.frm) and project (Ch6Proj1.vbp) files in a newly created folder named Ch6Proj1. If you create the Excel test plan at school, save it in the same Ch6Proj1 folder.
Preconditions:
Staple your printouts in the following order: