using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp9 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { double przedmiot1 = double.Parse(t1.Text); double przedmiot2 = double.Parse(t2.Text); double przedmiot3 = double.Parse(t3.Text); double przedmiot4 = double.Parse(t4.Text); double przedmiot5 = double.Parse(t5.Text); double wynik = (przedmiot1 + przedmiot2 + przedmiot3 + przedmiot4 + przedmiot5) / 5; MessageBox.Show("Średnia wynosi: " + wynik); } catch { MessageBox.Show("wprowadzono złe dane"); } } private void label1_Click(object sender, EventArgs e) { } } }