Exemple #1
0
        public static void Tehtava()
        {
            Vahvistin samsung = new Vahvistin();
            int       newVolume;

            for (int i = 0; i < 10; i++)
            {
                VolumeNyt(samsung);

                newVolume = Ask();
                if (newVolume > 100)
                {
                    Console.WriteLine("-> Too much volume ");
                    samsung.changes(100);
                }
                else if (newVolume < 1)
                {
                    Console.WriteLine("-> Too low volume ");
                    samsung.changes(0);
                }

                else
                {
                    samsung.changes(newVolume);
                }
            }
        }
Exemple #2
0
 public static void VolumeNyt(Vahvistin vahvistin)
 {
     Console.WriteLine("-> Amplifier volume is set to : " + vahvistin.Volume);
 }