Identify the errors in the following program segment


1. Identify the errors in the following program segment.

Dim nums() As Integer = {1, 2, 3)
For Each num as Integer In nums
Num += 100
Next
MessageBox.Show(CStr(nums.Sum)

2. Determine the output displayed when the button is clicked:

Structure College
Dim name As String
Dim stat As String
Dim yearFounded As Integer
End Structure
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim school As College
school.name = "USC"
school.state = "CA"
school.yearFounded = 1880
‘Now.Year is the current year
Dim age As Integer = Now.Year - school.yearFounded
txtOutput.Text = school.name & " is " & age & "years old."
End Sub

3. Write a program using the file Baseball.txt that requests a team as input from a list and displays the players from that team.
The players should be sorted in decreasing order by the number of hits they had during the season. The Baseball.txt file contains data about the performance of major league baseball players during the 2009 regular season. Each record of the file contains four fields - name, team, atBats, and hits. Some lines of the file are as follows:
Aaron Hill, Blue Jays, 682, 195
Ichiro Suzuki, Mariners, 639, 225
Derek Jeter, Yankees, 634, 212
The output should look like the following:

1534_program.png

4. Determine the errors in the following code.

Structure Vitamins
Dim a As Double
Dim c As Double
End Structure
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim minimum As Vitamins
minimum.c = 60
minimum.a = 5000
lstOutput.Items.Add(minimum)
End Sub

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Identify the errors in the following program segment
Reference No:- TGS01003610

Expected delivery within 24 Hours