mburaktekin
Hectopat
- Katılım
- 10 Eylül 2020
- Mesajlar
- 4.963
- Makaleler
- 2
- Çözümler
- 11
Daha fazla
- Cinsiyet
- Erkek
Merhabalar. Benim bir e-okul tarzı programım var. Bu programda öğrenci bilgilerini ve notlarını giriyorsunuz ve daha sonra size ortalamayı söylüyor ve öğrencinin hangi belgeyi aldığını gösteriyor. Ben bu programa not olarak 100'den fazla bir sayı girildiğinde hata verip devam etmemesini sağlamak istiyorum. Direkt kapanma değil bu arada. Ekranda bir yazı yazsın ve öyle kalsın. Sorgulamayı yaptım 100'den büyük sayı girince ekrana bir yazı çıkıyor fakat programı durdurmayı yapamadım. Kodun şu anki halini aşağıya bırakıyorum.
[CODE lang="csharp" title="kod"]using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
string ad, soyad;
double not1, not2, proje, ort;
Console.Write("İsminizi giriniz: ");
ad = Console.ReadLine();
Console.Write("Soyisminizi giriniz: ");
soyad = Console.ReadLine();
Console.WriteLine("****NOT GIRISI****");
Console.Write("1. Notu giriniz: ");
not1 = Convert.ToInt16(Console.ReadLine());
if (not1 > 100)
{
Console.WriteLine("Not puanı 100'den büyük olamaz!");
Console.Read();
}
Console.Write("2. Notu Giriniz: ");
not2 = Convert.ToInt16(Console.ReadLine());
if (not2 > 100)
{
Console.WriteLine("Not puanı 100'den büyük olamaz!");
Console.Read();
}
Console.Write("Proje Notunu Giriniz: ");
proje = Convert.ToInt32(Console.ReadLine());
if (proje>100)
{
Console.WriteLine("Not puanı 100'den büyük olamaz!");
Console.Read();
}
Console.WriteLine("***NOT BILGILERI***");
ort = (not2 + not1 + proje)/3;
Console.WriteLine("1. Not: " + not1);
Console.WriteLine("2. Not: " + not2);
Console.WriteLine("Proje Notu: " + proje);
Console.WriteLine("Ortalama: "+ ort);
if (100>=ort && ort>=85)
{
Console.WriteLine("Takdir Belgesi.");
}
else if(85>ort && ort>75)
{
Console.WriteLine("Teşekkür Belgesi.");
}
else if (75>ort)
{
Console.WriteLine("Belge alamadınız.");
}
Console.Read();
}
}
}[/CODE]
[CODE lang="csharp" title="kod"]using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
string ad, soyad;
double not1, not2, proje, ort;
Console.Write("İsminizi giriniz: ");
ad = Console.ReadLine();
Console.Write("Soyisminizi giriniz: ");
soyad = Console.ReadLine();
Console.WriteLine("****NOT GIRISI****");
Console.Write("1. Notu giriniz: ");
not1 = Convert.ToInt16(Console.ReadLine());
if (not1 > 100)
{
Console.WriteLine("Not puanı 100'den büyük olamaz!");
Console.Read();
}
Console.Write("2. Notu Giriniz: ");
not2 = Convert.ToInt16(Console.ReadLine());
if (not2 > 100)
{
Console.WriteLine("Not puanı 100'den büyük olamaz!");
Console.Read();
}
Console.Write("Proje Notunu Giriniz: ");
proje = Convert.ToInt32(Console.ReadLine());
if (proje>100)
{
Console.WriteLine("Not puanı 100'den büyük olamaz!");
Console.Read();
}
Console.WriteLine("***NOT BILGILERI***");
ort = (not2 + not1 + proje)/3;
Console.WriteLine("1. Not: " + not1);
Console.WriteLine("2. Not: " + not2);
Console.WriteLine("Proje Notu: " + proje);
Console.WriteLine("Ortalama: "+ ort);
if (100>=ort && ort>=85)
{
Console.WriteLine("Takdir Belgesi.");
}
else if(85>ort && ort>75)
{
Console.WriteLine("Teşekkür Belgesi.");
}
else if (75>ort)
{
Console.WriteLine("Belge alamadınız.");
}
Console.Read();
}
}
}[/CODE]
Son düzenleme: