Question: Overview: Write a program to input grades from a form, validate them, and perform various manipulations Use good design and coding skills as discussed in
Overview: Write a program to input grades from a form, validate them, and perform various manipulations Use good design and coding skills as discussed in class
1) Create an array Scores that can hold up to 50 double values. Create array at Form (Class) level (not in a button event handler). Class level scope
2) Allow users to enter multiple test scores one at a time - from a textbox or an InputBox (your choice).
3) Add each score to the array. One option have an Add button on your form add it to the array. When users are done entering scores they could indicate it by clicking a different button and the Add button could be disabled. If you have a different idea you may use that. **Important users may enter 50 or less scores you need to count how many are actually loaded so that you can skip any unused scores in the array.
4) Calculate and display the largest score, the smallest score and the average score. Use loops not the built-in array methods. Add up and display the number of A grades, B grades, C grades, D grades and F grades. Use a Select Case. An A is 90 and up, a B 80 and up (to the A range), C 70 and up etc. Make sure you handle decimal places correctly: (test your program very carefully) 69.4 is a D 69.5 is a C **Remember unless you tell it otherwise, Math.Round uses Bankers Rounding
5) Write your output as a report to a ListBox Control. Remember to use a fixed-width font. lstGrade.Items.Add( )
6) Add validation. Validate each score for the following use a function for each validation (remember the functions we looked at in class and used last week): Not empty Double data type Between 0 and 100.99 o Round the score to 2 decimal places using Math.Round before doing range validation (you can do this inside the IsWithinRange function) Use descriptive error messages. Create a function called IsValidData that will check to see if the data is valid.
7) Look up the Padleft and PadRight string methods in the book and VB documentation. Incorporate them into your output code so that all the numbers in your report line up right justified.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
