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

Need help urgently with this one. Please explain with visual basic forms and cod

ID: 3688715 • Letter: N

Question

Need help urgently with this one. Please explain with visual basic forms and coding.

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 name 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 the 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 the team. Input Validation: Do not accept negative numbers as points.

Explanation / Answer

Public Class Form1
Public names(100) As String
Public scores(100) As Integer
Public n As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


n = InputBox("enter how many players")
For i = 1 To n
names(i) = InputBox("Enter name of " & i & "player")

Next


End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim n As Integer
n = InputBox("Enter player number")
scores(n) = InputBox("Enter score")

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
For i = 1 To n
MsgBox(names(i) & ", " & scores(i))
Next

End Sub
End Class