5 Mart 2015 Perşembe

C# Vize ve Final Notu Hesaplama Form Application






















using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;



namespace vize_final_not_hesaplama
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        double vize, final, final2, ort;
        private void button1_Click(object sender, EventArgs e)
        {          
            double.TryParse(textBox1.Text, out vize);
            double.TryParse(textBox2.Text, out final);
            if (vize < 0)
            {
                vize = 0;
                textBox1.Text = "0";
            }
            if (final < 0)
            {
                final = 0;
                textBox2.Text = "0";
            }
            if (vize > 100)
            {
                vize = 100;
                textBox1.Text = "100";
            }
            if (final > 100)
            {
                final = 100;
                textBox2.Text = "100";
            }

            vize = vize * 4 / 10;
            final2 = final * 6 / 10;
            ort = vize + final2;

            if (final < 50)
            {
                label3.Text="Ortalamanız: " + ort + " Harf Notunuz: FF";
                label3.ForeColor = Color.Red;
                MessageBox.Show("Final Sınavından 50 Barajını Geçemediğiniz İçin Kaldınız!!!","KALDINIZ!!!");
            }
            else
            {
                if (ort >= 90 && ort <= 100)
                {
                    label3.Text="Ortalamanız: " + ort + " Harf Notunuz: AA";
                    label3.ForeColor = Color.Green;
                }
                else if (ort >= 80 && ort < 90)
                {
                    label3.Text="Ortalamanız: " + ort + " Harf Notunuz: BA";
                    label3.ForeColor = Color.Black;
                }
                else if (ort >= 70 && ort < 80)
                {
                    label3.Text="Ortalamanız: " + ort + " Harf Notunuz: BB";
                    label3.ForeColor = Color.Black;
                }
                else if (ort >= 60 && ort < 70)
                {
                    label3.Text="Ortalamanız: " + ort + " Harf Notunuz: CB";
                    label3.ForeColor = Color.Black;
                }
                else if (ort >= 50 && ort < 60)
                {
                    label3.Text="Ortalamanız: " + ort + " Harf Notunuz: CC";
                    label3.ForeColor = Color.Black;
                }
                else if (ort >= 45 && ort < 50)
                {
                    label3.Text="Ortalamanız: " + ort + " Harf Notunuz: DD";
                    label3.ForeColor = Color.Black;
                }
                else if (ort >= 0 && ort < 45)
                {
                    label3.Text="Ortalamanız: " + ort + " Harf Notunuz: FF";
                    label3.ForeColor = Color.Red;
                }
            }
        }
    }
}

Paylaş:

0 yorum:

Yorum Gönder

Popüler

Son

Kategoriler