public void validateSelection()
        {
            selection = Console.ReadLine().ToLower();

            if (selection != "1" && selection != "2" && selection != "3" && selection != "quit" && selection == "")
            {
                Console.WriteLine("That is not a valid input. Please try again...");
                validateSelection();

            }
            else if (selection == "1")
            {
                CourseInfo courseInfo = new CourseInfo();
                courseInfo.Info();
            }
            else if (selection == "2")
            {
                PlayRound playRound = new PlayRound();
                playRound.addRound();
            }
            else if (selection == "3")
            {
                ScoreLog scoreLog = new ScoreLog();
                scoreLog.printScores();
            }
            else
            {
                Console.WriteLine("Goodbye.");
            }
        }
Beispiel #2
0
        public void printScores()
        {
            string[] lines = File.ReadAllLines(@"C:\Users\kris.dawson\Documents\Visual Studio 2015\GolfApp\GolfApp\bin\pastScores.txt");

            System.Console.WriteLine("Score Log:");
            foreach (string line in lines)
            {
                Console.WriteLine(line);
            }

            Console.WriteLine(" ");
            Console.WriteLine("-------------------------------------------------------------");
            Console.WriteLine(" ");
            Console.WriteLine("Please select an option below:");
            Console.WriteLine("1.   Return to Main Menu");
            Console.WriteLine("2.   Quit");
            CourseInfo courseInfo = new CourseInfo();

            courseInfo.options();
        }