Ejemplo n.º 1
0
        public static FacultiesType Faculty()
        {
            FacultiesType faculty = new FacultiesType();
            int           choice  = 0;

            do
            {
                Console.WriteLine("Choose faculty");
                Console.WriteLine("1. Mathematics");
                Console.WriteLine("2. Law");
                Console.WriteLine("3. Business");
                Console.WriteLine("4. Philosophy");
                Console.WriteLine("5. Phisics");
                Console.WriteLine("6. Management");
                Console.WriteLine("7. Telecommunications");
                Console.Write("Your choice: ");
                choice = int.Parse(Console.ReadLine());
            } while (choice < 1 || choice > 7);

            switch (choice)
            {
            case 1:
                faculty = FacultiesType.Mathematics;
                break;

            case 2:
                faculty = FacultiesType.Law;
                break;

            case 3:
                faculty = FacultiesType.Business;
                break;

            case 4:
                faculty = FacultiesType.Philosophy;
                break;

            case 5:
                faculty = FacultiesType.Phisics;
                break;

            case 6:
                faculty = FacultiesType.Management;
                break;

            case 7:
                faculty = FacultiesType.Telecommunications;
                break;
            }

            return(faculty);
        }
Ejemplo n.º 2
0
 public Student(string firstName, string middleName, string lastName, string ssn, string address, string phoneNumber, string email, SpecialityType speciality, UniversityType university, FacultiesType faculties)
 {
     this.firstName   = firstName;
     this.middleName  = middleName;
     this.lastName    = lastName;
     this.ssn         = ssn;
     this.address     = address;
     this.phoneNumber = phoneNumber;
     this.email       = email;
     this.speciality  = speciality;
     this.university  = university;
     this.faculties   = faculties;
 }
Ejemplo n.º 3
0
        public static Student CreateStudent()
        {
            Console.Write("First name: ");
            string firstName = Console.ReadLine();

            Console.Write("Middle name: ");
            string middleName = Console.ReadLine();

            Console.Write("Last name: ");
            string lastName = Console.ReadLine();

            Console.Write("SSN: ");
            string ssn = Console.ReadLine();

            Console.Write("Address: ");
            string address = Console.ReadLine();

            Console.Write("Phone number: ");
            string phoneNumber = Console.ReadLine();

            Console.Write("E-mail: ");
            string email = Console.ReadLine();

            Console.Clear();

            UniversityType university = University();

            Console.Clear();

            FacultiesType faculty = Faculty();

            Console.Clear();

            SpecialityType speciality = Speciality();

            Console.Clear();

            Student student = new Student(firstName, middleName, lastName, ssn, address, phoneNumber, email, speciality, university, faculty);

            return(student);
        }