コード例 #1
0
        public SwitchBoardSimulator()
        {
            string NoOfFan, NoOfAC, NoOfBulb;

            do
            {
                Console.WriteLine("Enter the numberof Fan : ");
                NoOfFan = Console.ReadLine();
            }while(!IsValidNumber(NoOfFan));
            do
            {
                Console.WriteLine("Enter the numberof AC : ");
                NoOfAC = Console.ReadLine();
            }while(!IsValidNumber(NoOfAC));
            do
            {
                Console.WriteLine("Enter the numberof Bulb : ");
                NoOfBulb = Console.ReadLine();
            }while(!IsValidNumber(NoOfBulb));

            switchBoard = new SwitchBoard(int.Parse(NoOfFan), int.Parse(NoOfAC), int.Parse(NoOfBulb));
        }