Exemplo n.º 1
0
 static void PrintEmployees(InternalFatCatsIterator iterCompany, Company printCompany)
 {
     Console.WriteLine(printCompany.CompanyName() + printCompany.CompanyDescription());
     for (iterCompany.first(); iterCompany.isdone(); iterCompany.next())
     {
         iterCompany.currentItem().DisplayEmployee();
     }
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Company Coke = new Company("Coca-Cola: ", "a Soda Company\n");

            Employee Dave = new Employee("Dave", "993411234", 200000);
            Employee Jessica = new Employee("Jessica", "777411234", 120000);
            Employee John = new Employee("John", "342411234", 320000);

            Coke.AddEmployee(Dave);
            Coke.AddEmployee(Jessica);
            Coke.AddEmployee(John);

            InternalFatCatsIterator mainIter2 = new InternalFatCatsIterator(Coke);
            InternalReturnAllIterator mainIter = new InternalReturnAllIterator(Coke);

            PrintEmployees(mainIter, Coke);
            Console.WriteLine("/////////////////////////////////////////");
            PrintEmployees(mainIter2, Coke);
        }