示例#1
0
        public static void Zadatak3()
        {
            Console.WriteLine("Zadatak 3\n");
            List <IRentable> list = new List <IRentable>
            {
                new Book("Zlocin i kazna"),
                new Video("Sam u kuci")
            };
            RentingConsolePrinter printer = new RentingConsolePrinter();

            printer.DisplayItems(list);
            printer.PrintTotalPrice(list);
            Console.WriteLine("\n***************************************\n");
        }
示例#2
0
        public static void Zadatak5()
        {
            Console.WriteLine("Zadatak 5\n");
            List <IRentable> flashSale = new List <IRentable>
            {
                new DiscountedItem(new Book("Zlocin i kazna")),
                new DiscountedItem(new Video("Sam u kuci")),
                new DiscountedItem(new HotItem(new Book("Zlocin i kazna 2"))),
                new DiscountedItem(new HotItem(new Video("Sam u kuci 2")))
            };
            RentingConsolePrinter printer = new RentingConsolePrinter();

            printer.DisplayItems(flashSale);
            printer.PrintTotalPrice(flashSale);
            Console.WriteLine("\n***************************************\n");
        }
示例#3
0
        public static void Zadatak4()
        {
            Console.WriteLine("Zadatak 4\n");
            List <IRentable> list = new List <IRentable>
            {
                new Book("Zlocin i kazna"),
                new Video("Sam u kuci"),
                new HotItem(new Book("Zlocin i kazna 2")),
                new HotItem(new Video("Sam u kuci 2"))
            };
            RentingConsolePrinter printer = new RentingConsolePrinter();

            printer.DisplayItems(list);
            printer.PrintTotalPrice(list);
            Console.WriteLine("\n***************************************\n");
            //Sada imamo Trending: Prije imena
        }
示例#4
0
        static void Main(string[] args)
        {
            /*                  2. zadatak
             * Dataset dataset = new Dataset("CSV.txt");
             * Analyzer3rdParty analyzer3RdParty = new Analyzer3rdParty();
             * IAnalytics adapter = new Adapter(analyzer3RdParty);
             *
             *
             * double[] AvgPerColumn = adapter.CalculateAveragePerColumn(dataset);
             * double[] AvgPerRow = adapter.CalculateAveragePerRow(dataset);
             *
             * for(int i = 0; i < AvgPerColumn.Length; i++)
             * {
             *  Console.WriteLine(AvgPerColumn[i]);
             * }
             *
             * for (int i = 0; i < AvgPerRow.Length; i++)
             * {
             *  Console.WriteLine(AvgPerRow[i]);
             * }
             */



            /*          3. zadatak
             * List<IRentable> rentables = new List<IRentable>();
             * RentingConsolePrinter rentingConsolePrinter = new RentingConsolePrinter();
             *
             * rentables.Add(new Video("The Lord of the Rings"));
             * rentables.Add(new Book("Harry Potter"));
             *
             * rentingConsolePrinter.PrintTotalPrice(rentables);
             * rentingConsolePrinter.DisplayItems(rentables);
             */



            /*              4. Zadatak
             * List<IRentable> rentables = new List<IRentable>();
             * RentingConsolePrinter rentingConsolePrinter = new RentingConsolePrinter();
             *
             * rentables.Add(new Video("The Lord of the Rings"));
             * rentables.Add(new Book("Harry Potter"));
             * rentables.Add(new HotItem(new Video("Avengers: Endgame")));
             * rentables.Add(new HotItem(new Book("The Chronicles of Narnia")));
             *
             * rentingConsolePrinter.PrintTotalPrice(rentables);
             * rentingConsolePrinter.DisplayItems(rentables);
             *
             * //Svaka hit knjiga i svaki hit film u ispisu ima "Trending:" pod description. Override-ana je metoda
             */



            List <IRentable>      rentables             = new List <IRentable>();
            RentingConsolePrinter rentingConsolePrinter = new RentingConsolePrinter();

            rentables.Add(new Video("The Lord of the Rings"));
            rentables.Add(new Book("Harry Potter"));
            rentables.Add(new HotItem(new Video("Avengers: Endgame")));
            rentables.Add(new HotItem(new Book("The Chronicles of Narnia")));
            rentables.Add(new DiscountedItem(new Video("The replacements")));
            rentables.Add(new DiscountedItem(new Book("Junaci Pavlove ulice")));

            rentingConsolePrinter.PrintTotalPrice(rentables);
            rentingConsolePrinter.DisplayItems(rentables);
        }