public Sportay (string name, int age)
this.jumps= new double[5];
public Sportay (Sportay sp)
this.jumps=new double[5];
for (int i=0; i< sp.jumps.Length; i++)
this.jumps[i]=sp.jumps[i];
Console.WriteLine("Enter a Sportay (name, age, 5 jumps)");
this.name=Console.ReadLine();
this.age=int.Parse(Console.ReadLine());
this.jumps= new double[5];
for (int i=0; i< jumps.Length; i++)
this.jumps[i]= double.Parse(Console.ReadLine());
public double[] GetJumps()
public void SetName (string name)
public void SetAge (int age)
public void SetJumps(double[] jumps)
for (int i=0; i< jumps.Length; i++)
for (int i=0; i<this.jumps.Length; i++)
return (sum/this.jumps.Length);
public bool Younger (Sportay sp)
return (this.age< sp.GetAge());
public override string ToString()
string r= "Name: "+this.name+" Age: "+this.age+" Jumps: ";
for (int i=0; i<this.jumps.Length; i++)
private Sportay[] sportaim;
public Team(string teamName)
this.sportaim= new Sportay[n];
this.teamName= te.GetTeamName();
this.sportaim= new Sportay[n];
for (int i=0; i<te.GetSportaim().Length; i++)
this.sportaim[i]=new Sportay(te.GetSportaim()[i]);
this.teamName= Console.ReadLine();
this.sportaim= new Sportay[n];
for (int i=0; i< this.sportaim.Length; i++)
this.sportaim[i]= new Sportay();
public string GetTeamName()
public Sportay[] GetSportaim()
public void SetTeamName (string teamName)
public void SetSportaim(Sportay[] sps)
for (int i=0; i<sps.Length; i++)
public double HighTeamAvg()
double max= this.sportaim[0].Avg();
for (int i=0; i< this.sportaim.Length; i++)
if( max< this.sportaim[i].Avg())
max= this.sportaim[i].Avg();
public double LowTeamAvg()
double min= this.sportaim[0].Avg();
for (int i=0; i< this.sportaim.Length; i++)
if( min> this.sportaim[i].Avg())
min= this.sportaim[i].Avg();
public int ManyYounger (Sportay sp)
for (int i=0; i< this.sportaim.Length; i++)
if (this.sportaim[i].Younger(sp))
public string[] NameOfLowAvg (Sportay sp)
for (int i=0; i< this.sportaim.Length; i++)
if (this.sportaim[i].Avg()< sp.Avg())
string[] Names= new string[count];
for (int i=0; i< this.sportaim.Length; i++)
if (this.sportaim[i].Avg()< sp.Avg())
Names[count]= this.sportaim[i].GetName();
public override string ToString()
string r= "Team Name: "+this.teamName+" Sportaim: ";
for (int i=0; i<this.sportaim.Length; i++)
r= r+this.sportaim[i]+", ";
public static double LowestAvg()
Console.WriteLine("Enter a Team name");
string name= Console.ReadLine();
Sportay[] sps=new Sportay[10];
for (int i=0; i<sps.Length; i++)
Sportay sp= new Sportay();
if( tm.ManyYounger(sp)>=5 && sp.Avg()>tm.LowTeamAvg())
Console.WriteLine("The player "+sp+" was accepted");
for (int i=0; i<tm.NameOfLowAvg(sp).Length-1; i++)
Console.Write((tm.NameOfLowAvg(sp)[i])+" ,");
Console.WriteLine(tm.NameOfLowAvg(sp)[tm.NameOfLowAvg(sp).Length-1]);
public static void Main()