int[] grades = new int[5];
Console.WriteLine("what is ur name?");
Name = Console.ReadLine();
Console.WriteLine("enter ur 5 grades");
for (int i = 0; i < 5; i++)
grades[i] = int.Parse(Console.ReadLine());
public Talmid(string Name, Date birth)
this.birth = new Date(birth);
this.grades = new int[5];
Console.WriteLine("enter ur 5 grades");
this.grades[i] = int.Parse(Console.ReadLine());
this.birth = new Date(t.birth);
this.grades = new int[5];
for (int i = 0; i < grades.Length; i++)
Date temp = new Date(this.birth);
int[] copy = new int[this.grades.Length];
for (int i = 0; i < copy.Length; i++)
copy[i] = this.grades[i];
public void SetName(string Name)
public void SetBirth(Date d)
this.birth.SetDay(d.GetDay());
this.birth.SetMonth(d.GetMonth());
this.birth.SetYear(d.GetYear());
public void SetGrades(int[] grades)
for (int i = 0; i < grades.Length; i++)
this.grades[i] = grades[i];
for (int i = 0; i < this.grades.Length; i++)
return (double)sum / this.grades.Length;
public override string ToString()
string st = "name: " + this.Name + " ,birth: " + this.birth.ToString() + "grades: ";
for (int i = 0; i < grades.Length; i++)
st += this.grades[i] + " ";
Console.WriteLine("enter ur birthday");
day = int.Parse(Console.ReadLine());
month = int.Parse(Console.ReadLine());
year = int.Parse(Console.ReadLine());
public Date(int Day, int Month, int Year)
public void SetDay(int Day)
public void SetMonth(int Month)
public void SetYear(int Year)
public int ComperTo(Date other)
if (this.year == other.year)
if (this.month == other.month)
return (this.day - other.day);
return (this.month - other.month);
return (this.year - other.year);
public override string ToString()
return (day + "/" + month + "/" + year);
private int numOfStudent;
private Talmid[] talmidim;
public Kita(char level, int number, int numOfStudent, Talmid[] talmidim)
this.talmidim = new Talmid[numOfStudent];
this.numOfStudent = numOfStudent;
for (int i = 0; i < numOfStudent; i++)
this.talmidim[i] = talmidim[i];
public Kita(char level, int number)
Talmid[] talmidim = new Talmid[20];
Console.WriteLine("How many students are in this class?");
numOfStudent = int.Parse(Console.ReadLine());
for (int i = 0; i < numOfStudent; i++)
talmidim[i] = new Talmid();
Console.WriteLine("enter the level of the class");
level=char.Parse(Console.ReadLine());
Console.WriteLine("enter the number of the class");
number = int.Parse(Console.ReadLine());
Console.WriteLine("How many students are in this class?");
numOfStudent = int.Parse(Console.ReadLine());
for (int i = 0; i < numOfStudent; i++)
Console.WriteLine("enter your name");
name = Console.ReadLine();
talmidim[i] = new Talmid(name, t);
this.numOfStudent = t.numOfStudent;
for (int i = 0; i < numOfStudent; i++)
this.numOfStudent = t.numOfStudent;
return this.numOfStudent;
public Talmid[] GetTalmidim()
public void SetLevel(char level)
public void SetNumber(int number)
public void SetNOS(int numOfStudent)
this.numOfStudent = numOfStudent;
public Talmid BestStudent()
Talmid maxTalmid =new Talmid(talmidim[0]);
for(int i=0;i<talmidim.Length-1;i++)
if(talmidim[i].Avg()>talmidim[i+1].Avg())
maxTalmid = new Talmid(talmidim[i]);
public bool IsStudentInClass(Talmid st)
if(st.GetName()==talmidim[i].GetName())
public bool AddStudent(Talmid stu)
talmidim[numOfStudent + 1] = new Talmid(stu);
public override string ToString()
string m = "class: " + level + "-" + level + " there are: " + numOfStudent + "students and their infos are: ";
for(int i=0;i<numOfStudent;i++)
m += talmidim[i].ToString() + " ";
public static void Main(string[] args)
Kita one = new Kita('i', 5);
Console.WriteLine(one.ToString());
Console.WriteLine(two.ToString());
else if (two.AddStudent(c))
else if (two.AddStudent(b))
Console.WriteLine(one.ToString());
Console.WriteLine(two.ToString());
Console.WriteLine(one.BestStudent().GetName() + " is the best students of the first class" );
Console.WriteLine(two.BestStudent().GetName() + " is the best students of the second class");
Talmid search = new Talmid();
for(int i=0;i<one.GetNOS();i++)
if(one.GetTalmidim()[i]==search)
Console.WriteLine("the student that ur looking for is in the first class");
else if(two.GetTalmidim()[i] == search)
Console.WriteLine("the student that ur looking for is in the second class");
for(int i=0;i<one.GetNOS();i++)
if (one.GetTalmidim()[i].Avg() < 56)
for(int i=0;i<two.GetNOS();i++)
if (two.GetTalmidim()[i].Avg() < 56)
Console.WriteLine("in the first class there are " + sum1+" students with bad avg");
Console.WriteLine("in the second class there are " + sum2 + " students with bad avg");
if(one.BestStudent().Avg()>two.BestStudent().Avg())
Console.WriteLine("the smartest student is "+one.BestStudent().GetName()+" from the first class");
if (one.BestStudent().Avg() < two.BestStudent().Avg())
Console.WriteLine("the smartest student is " + two.BestStudent().GetName() + " from the second class");
for (int i = 0; i < one.GetNOS(); i++)
if (one.GetTalmidim()[i].Avg() > 85)
for (int i = 0; i < two.GetNOS(); i++)
if (two.GetTalmidim()[i].Avg() > 85)
Console.WriteLine(sum4+sum3+" students above 85 avg");