Merhaba arkadaşlar c# da yeni sayılırım ve ufak programcıklar yazmaya çalışıyorum. yazmaya çalıştıgım kodlarda şimdilik kullanıcıdan ders sayısını alıp bu sayı kadar ders adı ve not soruyor ve ekrana basıyor. bunda sıkıntı yok taki sınav sayısınıda döngüye dahil edinciye kadar kod hata vermiyor ama çalışmıyorda.
kodlar:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace not
{
class not
{
static void Main(string[] args)
{
/*int[] notlar = new int[3];
for (int i = 0; i < 3; i++)
{
Console.Write((i + 1) + " . sınav notunu gir : ");
notlar = Convert.ToInt16(Console.ReadLine());
}*/
Console.WriteLine("Ders Sayısını gir:");
int a = Convert.ToInt32(Console.ReadLine());
int b = 0;
int[] notlar = new int;
string[] dersler = new string;
for (int i = 0; i < a; i++)
{
Console.WriteLine((i + 1) + ". Dersin adı:");
dersler = Console.ReadLine();
Console.Write("Sınav Sayısı:");
b = Convert.ToInt32(Console.ReadLine());
for (int j = 0; j < b; j++)
{
Console.WriteLine((j+1)+" Notlar:");
notlar[j] = Convert.ToInt32(Console.ReadLine());
}
}
Console.WriteLine("Dersler:\tNotlar:");
for (int i = 0; i < dersler.Length; i++)
{
Console.WriteLine("{0}\t\t:{1}", dersler, notlar);
for (int j = 0; j < notlar.Length; j++)
{
Console.WriteLine("{0}\t\t:{1}", dersler, notlar[j]);
}
}
Console.ReadKey();
}
}
}