Ejemplo n.º 1
0
        }//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();
            }
        }
Ejemplo n.º 2
0
        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));
        }