Ensure that all variables, procedures and functions are well named. Excessive use of
class variables will be penalised.
You must use the methods names described below.
Ensure that you code contains appropriate comments. Code that is not correctly
commented will require resubmitting.
The top of the code in you form must include comments showing:
Student Name
Student Id
Tutor Name
Lab time
Explanation of Buttons:
When the user clicks the Set Default Scores button:
Call a Sub Procedure named Reset()
Call a Sub Procedure named AddDefaultScores()
Add the following values to the Scores listbox: 6,5,7,8,9,7,7,9
When the user clicks the Clear Scores button:
Call a Sub Procedure named Reset()
When the user clicks the Add Score button:
Call a Sub Procedure named AddOneScore()
When the user clicks the Add Random Score button:
Call a Sub Procedure named AddRandomScores()
When the user clicks the Show Statistics button:
Call a Sub Procedure named ShowStats()
Description of Methods Functions and Sub Procedures
Reset()
Method Type Sub Procedure
Parameters None
Description
Clear contents of Scores Listbox and Statistics
Output Label
Displays a message box with the message “All
scores have been reset”
Return Type None
AddDefaultScores()
Method Type Sub Procedure
Parameters None
Description Add these values to the Scores Listbox: 6,5,7,8,9,7,7,9
Return Type None
AddOneScore( )
Method Type Sub Procedure
Parameters None
Description
Uses an InputBox to asks the user for the score that should be
added.
Validate that the score is numeric and in the range 0 - 10
Add the score to the Scores Listbox:
Return Type None
AddRandomScores()
Method Type Sub Procedure
Parameters None
Description
Uses an InputBox to asks the user how many randomly
generated numbers that should be added.
Add the required number of randomly generated number in the
range 0-10 to the Scores Listbox:
Return Type None
DisplayOutput()
Method Type Sub Procedure
Parameters One String, one Boolean
Description
Displays the content of the String in the Statistics Output Label
(SOL)
Appends the String to the existing content of the SOL if
Boolean is TRUE, overwrites the existing content if the
Boolean is FALSE.
Return Type None
ShowStats()
Method Type Sub Procedure
Parameters None
Description
Calls CountScores(), then displays the return value using
DisplayOutput().
Calls SumScores(), then displays the return value using
DisplayOutput().
Calls AvgScore(), then displays the return value using
DisplayOutput().
Calls CountScoresBelowAverage(), then displays the
return value using DisplayOutput().
Calls CountScoresAboveOrEqualToAvg(), then displays
the return value using DisplayOutput().
Calls GetLowestScore(), then displays the return value
using DisplayOutput().
Calls CountMatchingScore(), passes it the Lowest Score
and then displays the return value using DisplayOutput().
Calls GetHighestScore(), then displays the return value
using DisplayOutput().
Calls CountMatchingScore(), passes it the Highest
Score and then displays the return value using
DisplayOutput().
Calls CountMatchingScore(), passes it the value in the
Textbox and then displays the return value using
DisplayOutput().
Calls CalcSpread(), passes it the Lowest Score & Highest
Score and then displays the return value using
DisplayOutput().
Displays the number of times each value in the range 1-10
appears in the Number Listbox using DisplayOutput()
Return Type None
CountScores ()
Method Type Function
Parameters None
Description Returns the Count of numbers Scores Listbox:
Return Type Integer
SumScores ()
Method Type Function
Parameters None
Description Returns the sum of all numbers Scores Listbox:
Return Type Integer
AvgScore()
Method Type Function
Parameters None
Description
Calls CountScores
If the return value is zero, then AvgScore must return 0.
Otherwise, you must call SumScores() and
CountScores() and then calculate the average. Use the
Math.Round built-in function to round off the answer to
2 decimal places and then return that value
Return Type Decimal
CountScoresAboveOrEqualToAvg()
Method Type Function
Parameters None
Description Calls AvgScore().
Returns the number of scores in the Scores
Listbox greater than the average
Return Type Integer
CountScoresBelowAvg()
Method Type Function
Parameters None
Description Calls AvgScore().
Returns the number of scores in the Scores
Listbox less than the average
Return Type Integer
GetLowestScore()
Method Type Function
Parameters None
Description Returns the lowest values found in the Scores Listbox
Return Type Integer
GetHighestScore()
Method Type Function
Parameters None
Description Returns the highest values found in the Scores
Return Type Integer
CountMatchingScore()
Method Type Function
Parameters An Integer
Description Calculates and Returns the number of scores in the Scores
Listbox that match the parameter value
Return Type Integer
CalcSpread()
Method Type Function
Parameters Two integers.
Description
Subtracts the first parameter value from the second parameter
value.
If the result is 0 then return "Spread is Zero"
If the result is <7 then return "Spread is small"
Otherwise return "Spread is large"
Return Type String
Performance expectation:
Your application is required to be able to produce the statistics on 10,000 scores in less than
four seconds. If your application is slower than this requirement discuss your code design
with your tutor.
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly complete the form.
Please provide a valid email address and we will get back to you within 24 hours.
Payment is through PayPal, Buy me a Coffee
or Cryptocurrency.
We are a nonprofit organization however we need funds to keep this organization operating
and to be able to complete our research and development projects.