Esempio n. 1
0
        static void Main(string[] args)
        {
            //1 i 2 zadatak
            //Dataset data = new Dataset("CSV.txt");
            //Analyzer3rdParty analyze = new Analyzer3rdParty();
            //Adapter adapter = new Adapter(analyze);
            //double[] re = adapter.CalculateAveragePerRow(data);
            //foreach (double rez in re)
            //{
            //    Console.WriteLine(rez);
            //}

            //double[] res = adapter.CalculateAveragePerColumn(data);

            //foreach (double rez in res)
            //{
            //    Console.WriteLine(rez);
            //}
            List <IRentable> list  = new List <IRentable>();
            Video            video = new Video("Juzni vetar");
            Book             book  = new Book("Gomora");

            list.Add(video);
            list.Add(book);
            RentingConsolePrinter rent = new RentingConsolePrinter();

            rent.DisplayItems(list);
            rent.PrintTotalPrice(list);


            List <IRentable> List2 = new List <IRentable>();
            HotItem          War   = new HotItem(new Book("broj55"));

            List2.Add(War);
            HotItem Domaci = new HotItem(new Video("Maratonci"));

            List2.Add(Domaci);
            RentingConsolePrinter Out2 = new RentingConsolePrinter();

            Out2.DisplayItems(List2);
            Out2.PrintTotalPrice(List2);

            List <IRentable> flashsale = new List <IRentable>();
            DiscountedItem   low1      = new DiscountedItem(video);
            DiscountedItem   low2      = new DiscountedItem(book);

            flashsale.Add(low1);
            flashsale.Add(low2);
            RentingConsolePrinter Out3 = new RentingConsolePrinter();

            Out3.DisplayItems(flashsale);
            Out3.PrintTotalPrice(flashsale);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //Z2
            //Dataset dataset = new Dataset(@"C:\Users\Elena\Source\Repos\lv4\lv4\bin\Debug\LV4.cvs");
            //Analyzer3rdParty party = new Analyzer3rdParty();
            //Adapter adapter = new Adapter(party);
            //double[] rowAverage = adapter.CalculateAveragePerRow(dataset);
            //double[] columnAverage = adapter.CalculateAveragePerColumn(dataset);

            //for (int i = 0; i < rowAverage.Length; i++)
            //{
            //    Console.Write(rowAverage[i] + " ");
            //}
            //Console.WriteLine();

            //for (int j = 0; j < columnAverage.Length; j++)
            //{
            //    Console.Write(columnAverage[j] + " ");
            //}
            //Console.WriteLine("\n");


            //Z3
            List <IRentable> rentable = new List <IRentable>();
            Book             book     = new Book("Crime and Punishment");

            rentable.Add(book);
            Movie video = new Movie("The Incredibles");

            rentable.Add(video);
            RentingConsolePrinter rent = new RentingConsolePrinter();

            rent.PrintTotalPrice(rentable);
            rent.DisplayItems(rentable);
            Console.WriteLine("\n");


            //Z4
            Book    book2   = new Book("Anna Karenina");
            Movie   video2  = new Movie("Avengers:Endgame");
            HotItem hotItem = new HotItem(book2);

            rentable.Add(hotItem);
            HotItem hotItem2 = new HotItem(video2);

            rentable.Add(hotItem2);
            rent.PrintTotalPrice(rentable);
            rent.DisplayItems(rentable);
            Console.WriteLine("\n");
        }