I have one final program to finish my chapter. Can you create the form and code
ID: 3692871 • 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
'on the form pl. place 3 buttons and add following coding
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
'This button is used to accept names of players
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
'This button is used to accept player number and put score for it
Dim n, aa As Integer
While (True)
n = InputBox("Enter positive player number")
aa = InputBox("Enter score")
If aa > 0 Then
scores(n) = aa
Exit While
End If
End While
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'This button is used to display Player names and their scores
For i = 1 To n
MsgBox(names(i) & ", " & scores(i))
Next
End Sub
End Class