private void outputButton_Click(object sender, EventArgs e) { Performance performance; if (choosePerformanceChildClassRButton.Checked == true) { performance = new PerformanceChild(Convert.ToInt32(startViewersCountTextBox.Text), Convert.ToInt32(endViewersCountTextBox.Text), nameTextBox.Text, Convert.ToInt32(yearOfWritingTextBox.Text)); outputLabel.Text = "Качество спектакля - " + Math.Round(performance.GetQuality(), 2); } else { performance = new Performance(Convert.ToInt32(startViewersCountTextBox.Text), Convert.ToInt32(endViewersCountTextBox.Text), nameTextBox.Text); outputLabel.Text = "Качество спектакля - " + Math.Round(performance.GetQuality(), 2); } }
static void Main(string[] args) { Performance performance; Console.Write("Введите название спектакля: "); string name = Console.ReadLine(); int startViewersCount = InputCheck("Введите начальное количество зрителей: "); int endViewersCount = InputCheck("Введите конечное количество зрителей: "); performance = new Performance(startViewersCount, endViewersCount, name); Console.WriteLine("Спектакль " + performance.Name + " создан"); Console.WriteLine("Качество спектакля - " + performance.GetQuality()); Console.Write("\nВведите название второго спектакля: "); name = Console.ReadLine(); startViewersCount = InputCheck("Введите начальное количество зрителей: "); endViewersCount = InputCheck("Введите конечное количество зрителей: "); int yearOfWriting = InputCheck("Введите год написания спектакля: "); performance = new PerformanceChild(startViewersCount, endViewersCount, name, yearOfWriting); Console.WriteLine("Качество спектакля - " + performance.GetQuality()); Console.ReadKey(); }