예제 #1
0
파일: Queue.cs 프로젝트: jcbbaccay/Garage
        public void Choice(out int result)
        {
            Console.WriteLine("Enter your choice:");
            try
            {
                result = Convert.ToInt32(Console.ReadLine());

                if (result >= 6 || result < 0)
                {
                    throw new FormatException();
                }
                else
                {
                    Todo(result);
                }
            }
            catch (FormatException)
            {
                result = 0;
                Console.Clear();
                Console.WriteLine("Incorrect input, choose only from 1 to 5.");
                Queue.UI();
                this.Choice(out result);
            }
        }
예제 #2
0
파일: Queue.cs 프로젝트: jcbbaccay/Garage
        Queue <int> outsideQ = new Queue <int>(); //Queue for vehicles outside the parking slot
        public void QueueOperations()
        {
            int result = 5;

            Queue.UI();
            this.Choice(out result);
            this.Todo(result);
        }