Esempio n. 1
0
        static Gymnast newGymnast()
        {
            Gymnast newGymnast = new Gymnast();

            Console.WriteLine("Enter gymnast's name");
            newGymnast.Name = Console.ReadLine();
            Console.WriteLine("Enter gymnast's surname");
            newGymnast.Surname = Console.ReadLine();
            Console.WriteLine("Enter gymnast's skill level");
            newGymnast.SkillLevel = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Enter gymnast's nationality");
            string tmp = Console.ReadLine();

            switch (tmp)
            {
            case "French": newGymnast.Nationality = Nationality.French; break;

            case "German": newGymnast.Nationality = Nationality.German; break;

            case "Italian": newGymnast.Nationality = Nationality.Italian; break;

            case "Polish": newGymnast.Nationality = Nationality.Polish; break;

            case "Korean": newGymnast.Nationality = Nationality.Korean; break;

            case "Ukrainian": newGymnast.Nationality = Nationality.Ukrainian; break;

            default: new Exception("Error nationality"); break;
            }

            return(newGymnast);
        }
Esempio n. 2
0
 public Perfomance(Gymnast g, double judgemark, double GymSkill)
 {
     this.gymnast   = g;
     this.judgemark = judgemark;
     this.GymSkill  = GymSkill;
     // total Mark is average of judges marks amd gymnast skill
     this.totalMark = (judgemark + GymSkill) / 2;
 }