Exemplo n.º 1
0
        private static void EnterGrades(IBook Br)
        {
            var    input = "";
            Double Grade;

            while (true)
            {
                Console.WriteLine("Enter Grades or q to quit");
                input = Console.ReadLine();
                if (input == "q")
                {
                    break;
                }
                try
                {
                    Grade = Convert.ToDouble(input);
                    Br.AddGrades(Grade);
                }
                catch (ArgumentException ex)
                { Console.WriteLine(ex.Message); }
                catch (FormatException ex)
                { Console.WriteLine(ex.Message); }
            }
        }