示例#1
0
文件: Program.cs 项目: Aggoh/Testing
        static void Main(string[] args)
        {
            Amplifier amplifier = new Amplifier();

            while (true)
            {
                Console.WriteLine("Ampplifiers volume is: " + amplifier.Volume);
                amplifier.Volume = int.Parse(Console.ReadLine());

            }
        }
示例#2
0
文件: Program.cs 项目: K1755/malli2
        static void Main(string[] args)
        {
            Amplifier amplifier = new Amplifier();
            bool      result;

            do
            {
                Console.Write("Give a new volume value (0-100) > ");
                string line   = Console.ReadLine();
                int    volume = 0;
                result = int.TryParse(line, out volume);
                if (result)
                {
                    amplifier.Volume = volume;
                }
            } while (result);

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();
        }