1. Anasayfa
  2. Visual Studio C#

Programlama Temelleri 2.Dönem 1.Yazılı Sınav Soru ve Cevapları A


1.Klavyeden negatif sayı girildiğinde programı sonlandıran program yapınız.

2.1 den 50 e kadar olan sayılar içinde 4 e veya 12 e tam bölünen sayıları bulup sayan ve toplayan programı yapınız.

3. Klavyeden öğrencinin vize ve final notları girilecek girilen notlardan vizenin % 40 ı , Finalin % 60 ı alınacak ve sonuç 50 ve üzeri ise dersten geçti değilse dersten kaldı uyarısı verecek programı yazınız.

CEVAPLAR
1-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication21
{
    class Program
    {
        static void Main(string[] args)
        {
            double toplam = 0;
            int sayi = 0;
                      do
            {
                toplam = toplam + sayi;
                Console.WriteLine("Sayı Girin");
                sayi = Convert.ToInt32(Console.ReadLine());
            }
            while (sayi >= 0);
            Console.WriteLine("Sayıların toplamı" + toplam.ToString());
            Console.ReadKey();
        }
    }
}

2-

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

namespace birden50ye
{
    class Program
    {
        static void Main(string[] args)
        {
            int sayi = 0, toplam = 0;
            for (int i = 1; i <= 50; i++)
            {
                if (i % 4 == 0 && i % 12 == 0)
                {
                    sayi++;
                    toplam += i;
                }
            }
            Console.WriteLine("Sayıların Toplamı=" + toplam.ToString());
            Console.WriteLine("Sayıların Adeti=" + sayi.ToString());
            Console.ReadKey();
        }
    }
}

3-

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

namespace vizefinal
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Vize Notunu Girin");
            int vize = Convert.ToInt16(Console.ReadLine());
            Console.WriteLine("Final Notunu Girin");
            int Final = Convert.ToInt16(Console.ReadLine());
            if ((vize * 0.4 + Final * 0.6) >= 50)
            {
                Console.WriteLine("Dersten Geçti");
            }
            else
            {
                Console.WriteLine("Dersten Kaldı");
            }
            Console.ReadKey();

        }
    }
}
Bu İçeriğe Tepkin Ne Oldu?
  • 0
    ba_ar_l_
    Başarılı
  • 0
    gayet_yi
    Gayet İyi
  • 0
    te_ekk_rler
    Teşekkürler
  • 0
    anlamad_m
    Anlamadım
  • 0
    yetersiz
    Yetersiz