Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Language needs to be Visual Basic. Lab 6 Winter 2021 Overview: Write a program to input grades from a form, validate them, and perform various
Language needs to be Visual Basic.
Lab 6 Winter 2021 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 Banker's Rounding 5) Write your output as a report to a ListBox Control. Remember to use a fixed-width font. IstGrade.Items.Add( Grade Report High Grade: 100.30 Low Grade 20.57 Put a string here Average Grade: 72.73 Number of As: 2 Number of Bs: 1 6) Add validation. Number of Cs: 0 Number of Ds: 0 Validate each score for the following use a function Number of Fs: 2 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 IsWithin Range function) Use descriptive error messages. Create a function called IsValid Data 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started