Not Ortalaması Hesaplama — Csharp
[code lang=”csharp”]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;//www.gorselprogramlama.com
using System.Windows.Forms;
namespace Coelho2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnHesapla_Click(object sender, EventArgs e)
{//www.gorselprogramlama.com
int Y1, Y2, Y3, S1, S2;
double Ortalama;
Y1 = int.Parse(txtY1.Text);
Y2 = int.Parse(txtY2.Text);
Y3 = int.Parse(txtY3.Text);
S1 = int.Parse(txtS1.Text);
S2 = int.Parse(txtS2.Text);
Ortalama = (Y1+Y2+Y3+S1+S2)/5;
if (Ortalama <= 100 && Ortalama >= 85) lblNotDurumu.Text = "Pekiyi";
else if (Ortalama <= 85 && Ortalama >= 70) lblNotDurumu.Text = "İyi";
else if (Ortalama <= 70 && Ortalama >= 55) lblNotDurumu.Text = "Orta";
else if (Ortalama <= 55 && Ortalama >= 45) lblNotDurumu.Text = "İdare Eder";
else if (Ortalama < 45 && Ortalama >= 0) lblNotDurumu.Text = "Kötü";
else lblNotDurumu.Text = "Geçersiz Not";//www.gorselprogramlama.com
lblOrtalama.Text = "Ortalama : " + Ortalama.ToString();
if (Ortalama >= 45) lblMesaj.Text = "TEBRİKLER GEÇTİNİZ.";
else lblMesaj.Text = "ÇOK ÜZGÜNÜM KALDINIZ.";
}
//www.gorselprogramlama.com
}
}
[/code]

