コード例 #1
0
        private void ViewTypeCost()
        {
            Console.WriteLine("What is the event type?\n" +
                              "1. Golf\n" +
                              "2. Bowling\n" +
                              "3. Concert\n" +
                              "4. Amusement Park");
            string    typeAsString = Console.ReadLine().ToLower();
            EventType type         = EventType.AmusementPark;

            switch (typeAsString)
            {
            case "golf":
            case "1":
                type = EventType.Golf;
                break;

            case "bowling":
            case "2":
                type = EventType.Bowling;
                break;

            case "concert":
            case "3":
                type = EventType.Concert;
                break;

            case "amusement park":
            case "4":
                type = EventType.AmusementPark;
                break;
            }
            decimal cost = _outingRepo.CalculateCostOfEventType(type);

            Console.WriteLine($"The cost is ${cost}");



            Console.ReadKey();
        }