Exemplo n.º 1
0
        public void AddToRoom()
        {
            RoomKeeper currentlyInRoom = new RoomKeeper();

            MaxStudent availablePlaces = new MaxStudent();

            var maxStudents = availablePlaces.MaxStudents();

            while (currentlyInRoom.newPerson.Count < maxStudents)
            {
                var addPerson = new MaxStudent();
                currentlyInRoom.newPerson.Add(addPerson);

                Console.WriteLine($"Currently in room {currentlyInRoom.newPerson.Count} people");
            }
        }
Exemplo n.º 2
0
        public void NewTeacher()
        {
            Random rnd        = new Random();
            int    newTeacher = rnd.Next(1, 2);

            RoomKeeper teacher = new RoomKeeper();

            if (newTeacher == 1)
            {
                var addTeacher = new MaxStudent();
                teacher.Add(addTeacher);

                Console.WriteLine("The teacher is already in the room");
            }
            else
            {
                Console.WriteLine("There is no teacher in the room");
            }
        }
Exemplo n.º 3
0
 public void Add(MaxStudent person)
 {
     newPerson.Add(person);
 }