Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is the problem from the \"Microsoft Visual Basic 2015 RELOADED 6th edition\

ID: 3815807 • Letter: H

Question

Here is the problem from the "Microsoft Visual Basic 2015 RELOADED 6th edition" book. Page 345, Chapter 6, exercise #25.

Open   the   solution   file   contained   in   the   VbReloaded2015Chap06Average   Solution folder. The calcButton_Click procedure should get from zero to five test scores from the user. Display the test scores in the scoresListBox. When the user has finished entering the scores, the procedure should calculate and display the average test score. Code the procedure. Save the solution and then start and test the application. Close the solution. (1, 2, 4–6, 8).
Also, I am a beginner at this that started with chapter 1 of this book so my knowledge in this is minute.

Here is the interface and code view:

For the code, the Options need to be: Option Explicit On, Option Strict On, Option Infer Off.

Thank you very much!

DA Average Solution Microsoft Visual Studi View Build Debug Team Format Tools Analyze Window Start Main Form vb* Main Form.vb [Des X Toolbox Search Toolbox All Windows Fo Average score Com mon Control Scores: Pointe alculate Average score: scoresl Button CheckBox EE CheckedListBox ComboBox DateTimePicker A Label A Link Labe ListView MaskedTextBox in MonthCalendar Notifyl Num Ba PictureBox ProgressBar RadioButton RichTextBox TextBox ToolTip TreeView WebBrowser D Containers Menus & Toolbars Data Components Rea Help 15, 15 389 x 199 R Quick Launch (ctrl Qy Sign in Solution Explore Search Solution Explorer (Ctrl+ Solution Average Solution' (1 project) M Average Project My Project References App.config D EH Main Form vb Properties Main System.Windows Forms Form Form 0,0 Maxi umSize MinimizeBox True Minimumsize 0,0 Opacity 0, 0, 0, 0 E Padding RightToLeft No Right ToLeftLayout Showlcon True ShowlnTaskbaar True 389, 199 Size Size GripStyl Auto StartPosition Center Screen Tag Average score Text Text The text ated ith e contr Publish 59 AM

Explanation / Answer

Assuming you enter space separated numbers in the Scores text box which signify the scores, i.e, like "1 2 3 4" or "10 20 30 40 50", we can do the following.

Assuming the scores text box is named as "txtScores" and the average scores label is named as "averageScores", the following code should work In the method calcButton_Click:

Dim scores = txtScores.value
Dim numbers = scores.Split().Count()
Dim sum = scores.Split().Select(Function(n) Integer.Parse(n)).Sum()
averageScore.value = sum/numbers

If the names of these elements are different, use the corresponding names. This should work!