public Talmid(string Name, Date birth)
this.birth = new Date(birth);
this.grades = new int[5];
public Talmid(string name)
Console.WriteLine("enter day:");
int day = int.Parse(Console.ReadLine());
Console.WriteLine("enter month:");
int month = int.Parse(Console.ReadLine());
Console.WriteLine("enter year:");
int year = int.Parse(Console.ReadLine());
this.birth = new Date(day, month, year);
this.grades = new int[5];
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];
public double AvgGrades()
for (int i = 0; i < this.grades.Length; i++)
return 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] + " ";
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);
public Node(T value, Node<T> next)
public void SetValue(T value)
public void SetNext(Node<T> next)
public override string ToString()
private int numOfStudents;
private Node<Talmid> talmidim;
public Kita(char level, int number)
public Kita(char level, int number, int numOfStudents, Node<Talmid> talmidim)
this.numOfStudents = numOfStudents;
Node<Talmid> n = talmidim;
if (this.talmidim == null)
this.talmidim = new Node<Talmid>(new Talmid(talmidim.GetValue()));
pos.SetNext(new Node<Talmid>( new Talmid(n.GetValue())));
Console.WriteLine("enter level: ");
this.level = char.Parse(Console.ReadLine());
Console.WriteLine("enter number: ");
this.number = int.Parse(Console.ReadLine());
Console.WriteLine("enter number of students: ");
this.numOfStudents = int.Parse(Console.ReadLine());
Node<Talmid> head = null, pos = null;
Console.WriteLine("האם להוסיף תלמיד?");
flag = bool.Parse(Console.ReadLine());
Console.WriteLine("enter name: ");
string name = Console.ReadLine();
Console.WriteLine("enter the day brithday: ");
int day = int.Parse(Console.ReadLine());
Console.WriteLine("enter the month brithday: ");
int month = int.Parse(Console.ReadLine());
Console.WriteLine("enter the year brithday : ");
int year = int.Parse(Console.ReadLine());
Date d = new Date(day, month, year);
Talmid t = new Talmid(name, d);
head = new Node<Talmid>(t);
pos.SetNext(new Node<Talmid>(t));
Console.WriteLine("האם להוסיף תלמיד?");
flag = bool.Parse(Console.ReadLine());
this.numOfStudents = k.numOfStudents;
Node<Talmid> n = k.talmidim;
if (this.talmidim == null)
this.talmidim = new Node<Talmid>(k.talmidim.GetValue());
pos.SetNext(new Node<Talmid>(n.GetValue()));
public int GetNumOfStudents()
public Node<Talmid> GetTalmidim()
Node<Talmid> copy = null,pos = null;
Node<Talmid> n = this.talmidim;
copy = new Node<Talmid>(n.GetValue());
pos.SetNext(new Node<Talmid>(n.GetValue()));
public void SetLevel(char level)
public void SetNumber(int number)
public void SetNumOfStudents(int numOfStudents)
this.numOfStudents=numOfStudent;
public void SetTalmidim(Node<Talmid> talmidim)
Node<Talmid> n = talmidim;
this.talmidim = new Node<Talmid>(talmidim.GetValue());
Node<Talmid> pos = this.talmidim;
pos.SetNext(new Node<Talmid>(n.GetValue()));
public void AddStu(Talmid t)
this.talmidim= new Node<Talmid>(t,this.talmidim);
public override string ToString()
string s = "level: " + level + ",number: " + number + "numOfStudents: " + numOfStudents + ",talmidim: ";
Node<Talmid> pos = this.talmidim;
pos.GetValue().ToString();
public static void Add(Kita k, Talmid t)
k.SetTalmidim(new Node<Talmid>(t,k.GetTalmidim()));
public static void Main()
Console.WriteLine("Hello World");