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 WindowsFormsApp48
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private int Ortalama(int yazili1,int yazili2,int sozlu)
{
return (yazili1 + yazili2 + sozlu) / 3;
}
private int Ortalama(int yazili1,int yazili2,int sozlu,int odev)
{
return (yazili1 + yazili2 + sozlu + odev) / 4;
}
private void button1_Click(object sender, EventArgs e)
{
if(textBox4.Text=="")
{
MessageBox.Show("Ortalama="+Ortalama(Convert.ToInt32(textBox1.Text),
Convert.ToInt32(textBox2.Text),
Convert.ToInt32(textBox3.Text)));
}
else
MessageBox.Show("Ortlama="+Ortalama(Convert.ToInt32(textBox1.Text),
Convert.ToInt32(textBox2.Text),Convert.ToInt32(textBox3.Text),
Convert.ToInt32(textBox4.Text)));
}
}
}