Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 8.1 X Accumulate Test Score Data Using an Array and a List 1. In this exercise, youll create a form that accepts one or

Exercise 8.1 X Accumulate Test Score Data Using an Array and a List

1. In this exercise, youll create a form that accepts one or more scores from the user. Each time a score is added, the score total, score count, and average score are calculated and displayed.

2. Add labels, text boxes, and buttons to the default form and set the properties of the form and its controls so they appear as shown above. When the user presses the Enter key, the Click event of the Add button should fire. When the user presses the Esc key, the Click event of the Exit button should fire.

3. Declare two class variables to store the score total and the score count.

4. Create an event handler for the Add button Click event. This event handler should get the score the user enters, calculate and display the score total, score count, and average score, and reset the focus to the Score text box. You can assume that the user will enter valid integer values and that they will be positive.

4. Create an event handler for the Click event of the Clear Scores button. This event handler should set the two class variables to zero, clear the text boxes on the form, and move the focus to the Score text box.

5. Create an event handler for the Click event of the Exit button that closes the form.

6. we are going to modify what has been done so far to store the entered data in list.and following the sort produce a dialog box containing the sorted data. (see pic).

7. Delete the class variable for the score count. This count is not needed anymore,

8. Modify the Click event handler for the Add button so it adds to the list the score thats entered by the user. In addition, delete the statement that increments the score count variable you just deleted.

9. Modify the Click event handler for the Display Scores button so it sorts the scores in the list and then displays them in a dialog box. Modify the dialog box so that it shows the count of the number of elements in the list.

10. Test the application to be sure it works correctly.

image text in transcribed

Score Calculator -1 Score: 98 Add Score total: 472 Scor re count: 5 Average: 94 Display Scores Clear Scores Exit Sorted Scores 89 92 96 97 98 OK

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

how would you have done things differently?

Answered: 1 week ago