Exemple #1
0
        static void Main()
        {
            //Initialize the repository
            SpaceStation spaceStation = new SpaceStation("Apolo", 10);
            //Initialize entity
            Astronaut astronaut = new Astronaut("Stephen", 40, "Bulgaria");

            //Print Astronaut
            Console.WriteLine(astronaut); //Astronaut: Stephen, 40 (Bulgaria)

            //Add Astronaut
            spaceStation.Add(astronaut);
            //Remove Astronaut
            spaceStation.Remove("Astronaut name"); //false

            Astronaut secondAstronaut = new Astronaut("Mark", 34, "UK");

            //Add Astronaut
            spaceStation.Add(secondAstronaut);

            Astronaut oldestAstronaut  = spaceStation.GetOldestAstronaut();    // Astronaut with name Stephen
            Astronaut astronautStephen = spaceStation.GetAstronaut("Stephen"); // Astronaut with name Stephen

            Console.WriteLine(oldestAstronaut);                                //Astronaut: Stephen, 40 (Bulgaria)
            Console.WriteLine(astronautStephen);                               //Astronaut: Stephen, 40 (Bulgaria)

            Console.WriteLine(spaceStation.Count);                             //2

            Console.WriteLine(spaceStation.Report());
            //Astronauts working at Space Station Apolo:
            //Astronaut: Stephen, 40 (Bulgaria)
            //Astronaut: Mark, 34 (UK)
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SpaceStation spaceStation = new SpaceStation("Apolo", 10);

            Astronaut astronaut = new Astronaut("Stephen", 40, "Bulgaria");

            Console.WriteLine(astronaut); //Astronaut: Stephen, 40 (Bulgaria)


            spaceStation.Add(astronaut);

            spaceStation.Remove("Astronaut name"); //false

            Astronaut secondAstronaut = new Astronaut("Mark", 34, "UK");


            spaceStation.Add(secondAstronaut);

            Astronaut oldestAstronaut  = spaceStation.GetOldestAstronaut();    // Astronaut with name Stephen
            Astronaut astronautStephen = spaceStation.GetAstronaut("Stephen"); // Astronaut with name Stephen

            Console.WriteLine(oldestAstronaut);                                //Astronaut: Stephen, 40 (Bulgaria)
            Console.WriteLine(astronautStephen);                               //Astronaut: Stephen, 40 (Bulgaria)

            Console.WriteLine(spaceStation.Count);                             //2

            Console.WriteLine(spaceStation.Report());
        }
Exemple #3
0
        public static void Main()
        {
            SpaceStation spaceStation = new SpaceStation("Apolo", 10);

            Astronaut astronaut = new Astronaut("Stephen", 40, "Bulgaria");

            Console.WriteLine(astronaut);

            spaceStation.Add(astronaut);

            spaceStation.Remove("Astronaut name");

            Astronaut secondAstronaut = new Astronaut("Mark", 34, "UK");

            spaceStation.Add(secondAstronaut);

            Astronaut oldestAstronaut = spaceStation.GetOldestAstronaut();

            Astronaut astronautStephen = spaceStation.GetAstronaut("Stephen");

            Console.WriteLine(oldestAstronaut);
            Console.WriteLine(astronautStephen);

            Console.WriteLine(spaceStation.Count);

            Console.WriteLine(spaceStation.Report());
        }
        public static void Main()
        {
            SpaceStation spaceStation = new SpaceStation("Apolo", 4);

            spaceStation.Add(new Astronaut("Izrael", 2, "Congo"));
            spaceStation.Add(new Astronaut("Jongo", 12, "Bulgaria"));
            spaceStation.Add(new Astronaut("Jongo", 13, "Mavritaniq"));
            spaceStation.Add(new Astronaut("Jongo", 12, "Mavritaniq"));

            Console.WriteLine(spaceStation.Count);
            Console.WriteLine(spaceStation.GetOldestAstronaut());
            Console.WriteLine(spaceStation.Report());
            Console.WriteLine(spaceStation.Remove("Jongo"));
            spaceStation.Add(new Astronaut("Vongo", 125, "Mavritaniq"));
            Console.WriteLine(spaceStation.Count);
            Console.WriteLine(spaceStation.Report());
            //Astronaut astronaut = new Astronaut("Stephen", 5, "Bulgaria");

            //spaceStation.Add(astronaut);

            //Console.WriteLine(spaceStation.Remove("Astronaut name"));

            //Astronaut secondAstronaut = new Astronaut("Mark", 34, "UK");

            //spaceStation.Add(secondAstronaut);

            //Astronaut oldestAstronaut = spaceStation.GetOldestAstronaut();
            //Astronaut astronautStephen = spaceStation.GetAstronaut("Stephen");
            //Console.WriteLine(oldestAstronaut);
            //Console.WriteLine(astronautStephen);

            //Console.WriteLine(spaceStation.Count);

            //Console.WriteLine(spaceStation.Report());
        }
Exemple #5
0
        public static void Main(string[] args)
        {
            //Initialize the repository
            SpaceStation spaceStation = new SpaceStation("Apolo", 10);
            //Initialize entity
            Astronaut astronaut = new Astronaut("Stephen", 40, "Bulgaria");

            //Print Astronaut
            Console.WriteLine(astronaut); //Astronaut: Stephen, 40 (Bulgaria)

            //Add Astronaut
            spaceStation.Add(astronaut);
            //Remove Astronaut
            spaceStation.Remove("Astronaut name"); //false
        }
Exemple #6
0
        public static void Main()
        {
            SpaceStation spaceStation = new SpaceStation("Apolo", 2);

            Astronaut astronaut1 = new Astronaut("Stephen", 40, "Bulgaria");
            Astronaut astronaut2 = new Astronaut("Ben", 30, "Bulgaria");
            Astronaut astronaut3 = new Astronaut("Gogi", 40, "Bulgaria");

            spaceStation.Add(astronaut1);
            spaceStation.Add(astronaut2);
            spaceStation.Add(astronaut3);

            Console.WriteLine();
            //Console.WriteLine(spaceStation.Report());


            ////Initialize the repository
            //SpaceStation spaceStation = new SpaceStation("Apolo", 10);
            ////Initialize entity
            //Astronaut astronaut = new Astronaut("Stephen", 40, "Bulgaria");
            ////Print Astronaut
            //Console.WriteLine(astronaut); //Astronaut: Stephen, 40 (Bulgaria)

            ////Add Astronaut
            //spaceStation.Add(astronaut);
            ////Remove Astronaut
            //spaceStation.Remove("Astronaut name"); //false

            //Astronaut secondAstronaut = new Astronaut("Mark", 34, "UK");

            ////Add Astronaut
            //spaceStation.Add(secondAstronaut);

            //Astronaut oldestAstronaut = spaceStation.GetOldestAstronaut(); // Astronaut with name Stephen
            //Astronaut astronautStephen = spaceStation.GetAstronaut("Stephen"); // Astronaut with name Stephen
            //Console.WriteLine(oldestAstronaut); //Astronaut: Stephen, 40 (Bulgaria)
            //Console.WriteLine(astronautStephen); //Astronaut: Stephen, 40 (Bulgaria)

            //Console.WriteLine(spaceStation.Count); //2

            //Console.WriteLine(spaceStation.Report());
            ////Astronauts working at Space Station Apolo:
            ////Astronaut: Stephen, 40 (Bulgaria)
            ////Astronaut: Mark, 34 (UK)
        }
Exemple #7
0
        static void Main(string[] args)
        {
            var astronaut  = new Astronaut("zefir", 11, "BG");
            var astronaut2 = new Astronaut("zefir", 13, "BG");
            var astronaut3 = new Astronaut("zefir", 14, "BG");
            var astronaut4 = new Astronaut("zefir", 15, "BG");
            var cosmos     = new SpaceStation("Amfo", 4);

            cosmos.Add(astronaut);
            cosmos.Add(astronaut);
            cosmos.Add(astronaut2);
            cosmos.Add(astronaut3);
            Console.WriteLine(cosmos.Count);
            Console.WriteLine(cosmos.Remove("zefir"));
            Console.WriteLine(cosmos.Report());
            Console.WriteLine(cosmos.GetOldestAstronaut());
            Console.WriteLine(cosmos.GetAstronaut("zefir"));
        }
        static void Main(string[] args)
        {
            //Initialize the repository
            SpaceStation spaceStation = new SpaceStation("Apolo", 2);
            //Initialize entity
            Astronaut astronaut1 = new Astronaut("Ivan", 400, "Bulgaia");
            Astronaut astronaut2 = new Astronaut("Stephen", 4, "Bulgaria");
            Astronaut astronaut3 = new Astronaut("johny", 0, "Bulgria");

            //Print Astronaut
            //Astronaut: Stephen, 40 (Bulgaria)

            //Add Astronaut
            spaceStation.Add(astronaut1);
            spaceStation.Add(astronaut2);
            spaceStation.Add(astronaut3);
            Console.WriteLine(spaceStation.Report());
            //Remove Ast
        }
        static void Main(string[] args)
        {
            SpaceStation spaceStation = new SpaceStation("Apolo", 10);

            Astronaut firstAstronaut = new Astronaut("Stephen", 40, "Bulgaria");

            Console.WriteLine(firstAstronaut);

            spaceStation.Add(firstAstronaut);

            Astronaut secondAstronaut = new Astronaut("John", 50, "America");

            spaceStation.Add(secondAstronaut);

            Console.WriteLine(spaceStation.GetOldestAstronaut());

            Console.WriteLine(spaceStation.GetAstronaut("John"));

            Console.WriteLine(spaceStation.Count);

            Console.WriteLine(spaceStation.Report());
        }