11 Temmuz 2011 Pazartesi

C# Vize, Final, Not Harfi Hesaplama

using System;
 using System.Collections.Generic;
 using System.Text;

 namespace Ornek
 {
 class Program
 {
 static void Main(string[] args)
 {
 // Klavyeden girilen vize ve final notuna göre öğrencinin geçme notunu
 // hem rakamla hem de harfle yazan programı yazınız.

 int vize, final, ort;
 string strVize, strFinal;

 Console.Write("Vize notunu giriniz: ");
 strVize = Console.ReadLine();
 vize = Int32.Parse(strVize);

 Console.Write("Final notunu giriniz: ");
 strFinal = Console.ReadLine();
 final = Int32.Parse(strFinal);

 ort = Convert.ToInt32(vize * 0.4 + final * 0.6);

 // 90 - 100 AA
 // 80 - 90 AB
 // 70 - 80 BB
 // 60 - 70 BC
 // 50 - 60 CC
 // 40 - 50 DC
 // 0 - 40 FF

 Console.WriteLine();

 if (ort >= 90 && ort <= 100) Console.WriteLine("Geçme Notu Rakamla: {0} Harfle: AA", ort); else if (ort >= 80 && ort < 90) Console.WriteLine("Geçme Notu Rakamla: {0} Harfle: AB", ort); else if (ort >= 70 && ort < 80) Console.WriteLine("Geçme Notu Rakamla: {0} Harfle: BB", ort); else if (ort >= 60 && ort < 70) Console.WriteLine("Geçme Notu Rakamla: {0} Harfle: BC", ort); else if (ort >= 50 && ort < 60) Console.WriteLine("Geçme Notu Rakamla: {0} Harfle: CC", ort); else if (ort >= 40 && ort < 50) Console.WriteLine("Geçme Notu Rakamla: {0} Harfle: DC", ort); else if (ort >= 0 && ort < 40) Console.WriteLine("Geçme Notu Rakamla: {0} Harfle: FF", ort);

 }
 }
 }

0 yorum:

Yorum Gönder