Beispiel #1
0
        private static void nactiZKlavesnice()
        {
            Console.WriteLine();
            string  jmeno = Reading.ReadString("Zadej jméno");
            int     cislo = Reading.ReadInt("Zadej číslo");
            string  temp  = Reading.ReadString("Zadej fakultu (FEI, FES, FF, FCHT)");
            Fakulta fak   = 0;

            switch (temp)
            {
            case "FEI":
                fak = Fakulta.FEI;
                break;

            case "FES":
                fak = Fakulta.FES;
                break;

            case "FF":
                fak = Fakulta.FF;
                break;

            case "FCHT":
                fak = Fakulta.FCHT;
                break;

            default:
                //TODO
                break;
            }
            p.pole[p.pocetPrvku] = new Student(jmeno, cislo, fak);
            p.pocetPrvku++;
        }
Beispiel #2
0
        public void LoadStudents(int numberOfStudents)
        {
            students = new Student[numberOfStudents];
            for (int i = 0; i < numberOfStudents; i++)
            {
                string name   = Reading.ReadString("Zadej jmeno studenta");
                int?   number = Reading.ReadInt("Zadej cislo studenta");
                if (number != null)
                {
                    Console.WriteLine(faculties);
                    int?          typeOfFaculty = Reading.ReadInt("Zadej fakultu");
                    TypeOfFaculty faculty;
                    switch (typeOfFaculty)
                    {
                    case 1: faculty = TypeOfFaculty.FES; break;

                    case 2: faculty = TypeOfFaculty.FF; break;

                    case 3: faculty = TypeOfFaculty.FEI; break;

                    case 4: faculty = TypeOfFaculty.FCHT; break;

                    default: faculty = TypeOfFaculty.FEI; break;
                    }
                    students[i] = new Student(name, (int)number, faculty);
                    Console.WriteLine("--------------------------------");
                }
            }
            Console.WriteLine("Studenti byly nacteni");
        }
Beispiel #3
0
        private void ArrayReading(Studenti arrayOfStudents)
        {
            string  jmeno       = Reading.ReadString("Jméno");
            int     cislo       = Reading.ReadInt("Číslo");
            string  fakulta     = Reading.ReadString("Fakulta");
            Student tempStudent = new Student(jmeno, cislo, fakulta);

            arrayOfStudents.AddStudent(tempStudent);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            string name   = Reading.ReadString("Your name");
            int    age    = Reading.ReadInt("Your age");
            double points = Reading.ReadDouble("Points");
            char   grade  = Reading.ReadChar("Grade");

            Console.WriteLine('\n' + name + '\n' + age + '\n' + points + '\n' + grade);
        }
Beispiel #5
0
        /// <summary>
        /// Vytvoří nového studenta
        /// </summary>
        /// <returns>Vrátí nového studenta</returns>
        private Student createStudent()
        {
            string  name;
            int     number;
            Faculty faculty;

            name   = Reading.ReadString("Zadej jméno");
            number = Reading.ReadInt("Zadej číslo");

            int numberFaculty;

            do
            {
                printFaculty();
                numberFaculty = Reading.ReadInt("Číslo fakulty");
            } while (numberFaculty < 0 || numberFaculty > countFaculty());

            faculty = getFacultyByPosition(numberFaculty);
            return(new Student(name, number, faculty));
        }