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

I have one final program to finish my chapter. Can you create the form and code

ID: 3692535 • Letter: I

Question

I have one final program to finish my chapter. Can you create the form and code for this question? I am unable to find help anywhere, and I pay for this service on the monthly. Suppose a soccer team needs an application to record the number of points scored by its players during a game. Create an application that asks how many players the team has and then asks for the names of each player. The program should declare an array of strings large enough to hold the player names and declare an array of integers large enough to hold the number of points scored by each player. The application should have a menu system or buttons that perform the following: Display a form allowing the user to enter the player's names. Display a form that can be used during a game to record the points scored by each player. Display the total points scored by each player and by the team. Use Visual Basic/Studio

Explanation / Answer

'Management form

Public Class Management

    Public Shared playerNames(50) As String

    Public Shared numPlayers As Integer = 0

    Public Shared score(50) As Integer

    Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click

        End

    End Sub

    Private Sub btnNameEntry_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNameEntry.Click

        Form1.Show()

    End Sub

    Private Sub btnScoreEntry_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScoreEntry.Click

        Form2.Show()

    End Sub

    Private Sub btnDisplayTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayTotal.Click

        Form3.Show()

    End Sub

End Class

---------------------------------------------------------------------------------------------

'Form1

Public Class Form1

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click

        End

    End Sub

    Private Sub btnAddPlayer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddPlayer.Click

        Management.playerNames(Management.numPlayers) = txtName.Text

        Management.numPlayers += 1

    End Sub

End Class

-----------------------------------------------------------------------------------

'Form2

Public Class Form2

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click

       Management.show()

    End Sub

    Private Sub btnAddScore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddScore.Click

        Management.score(ListBox1.SelectedIndex) = Val(txtScore.text)

    End Sub

End Class

----------------------------------------------------------------------------------

'Form3

Public Class Form3

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click

        Management.show()

    End Sub

    Private Sub btnDisplayTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplayTotal.Click

        Dim i As Integer

        Dim total As Integer = 0

        For i = 0 To Management.numPlayers

            total += Management.score(i)

        Next

        txtTotalScore.text = total

    End Sub

End Class