Question: C#: I am ran into an error and I do not know how to fix. Please help me resolve it. Below is the code and

C#: I am ran into an error and I do not know how to fix. Please help me resolve it. Below is the code and the screenshots of Error, Design & Assignment.

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO;

namespace SinghAjayProgram07 { public partial class worldSeriesChampions : Form { public worldSeriesChampions() { InitializeComponent(); }

List champList = new List();

int i = 0;

private void worldSeriesChampions_Load(object sender, EventArgs e) { StreamReader teamsFile = File.OpenText("Teams.txt");

StreamReader winnersFile = File.OpenText("WorldSeriesWinners.txt");

string reader;

while ((reader = teamsFile.ReadLine()) != null) { teamsListBox.Items.Add(reader); }

string temp;

temp = winnersFile.ReadLine();

while (temp != null) { champList.Add(temp); temp = winnersFile.ReadLine(); i++; } }

private void teamsListBox_SelectedIndexChanged(object sender, EventArgs e) { string reader = teamsListBox.SelectedItem.ToString();

int j = 0; int count = 0;

while (j

j++; }

MessageBox.Show(reader + "Won" + count + "times."); } } }

Error:

C#: I am ran into an error and I do not know

Design:

how to fix. Please help me resolve it. Below is the code

Assignment:

and the screenshots of Error, Design & Assignment. using System; using System.Collections.Generic;

World Series Champions List of World Series Champions Click on any team to find out how many times it has won World Series Championship teamsListBox Exit World Series Champions In the Chap07 folder of the Student Sample Programs, you will find the following files: Teams.txt This file contains a list of several Major League baseball teams in alphabetical order. Each team listed in the file has won the World Series at least once. WorldSeriesWinners.txt-This file contains a chronological list of the World Series' winning teams from 1903 through 2012. (The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2012. Note that the World Series was not played in 1904 or 1994.) Create an application that displays the contents of the Teams.txt file in a ListBox control. When the user selects a team in the ListBox, the application should display the number of times that team has won the World Series in the time period from 1903 through 2012

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!