}//End btnDiveScore //Gathers the total score of the Diver Selected private void btnTotalScore_Click(object sender, EventArgs e) { //Error check that a diver name is selected if (cmbDiverName.SelectedIndex == -1) { MessageBox.Show("Please make a diver selection"); } else { //Calculate the diverscore by calling TotalScore method in the diversClass and send it the index of the cmbDiverName txtTotalScore.Text = (divers.totalScore(cmbDiverName.SelectedIndex)).ToString(); } }
static void Main(string[] args) { int numDivers = 0; string fileName = ""; fileName = Console.ReadLine(); DiverClass class1 = new DiverClass(fileName); class1.FillArray(fileName); class1.Sort(); class1.PrintArray(); numDivers = class1.CountDivers(); Console.WriteLine("There are " + numDivers + " divers."); Console.WriteLine(class1.CalculateDive(3, 21)); Console.WriteLine(class1.totalScore(20)); }