Example #1
0
        static void Main(string[] args)
        {
            //Curs1

            //Console.WriteLine("This is my first C# project!");
            //Mercedes mercedes = new Mercedes();
            //EngineStruct engine1 = new EngineStruct();
            //ICar car = new Mercedes();
            //AbstractCar car2 = new Mercedes(5);
            //Console.WriteLine("Mercedes is: " + mercedes.Description);
            //Console.WriteLine("Mercedes costs: " + mercedes.Price);

            //Curs2

            //PrintLogo();
            //PrintLogo(1);
            //Mercedes mercedes1 = new Mercedes();
            ////mercedes.PrintMercedesLogo();
            //mercedes1.PrintNewMercedes(Mercedes.staticcounter++);
            //Mercedes mercedes2 = new Mercedes();
            //mercedes2.PrintNewMercedes(Mercedes.staticcounter++);
            //Mercedes mercedes3 = new Mercedes();
            //mercedes3.PrintNewMercedes(Mercedes.staticcounter++);
            //Mercedes mercedes4 = new Mercedes();
            //mercedes4.PrintNewMercedes(Mercedes.staticcounter++);
            //Mercedes.StartEngine();
            //mercedes1.ShowRemainingNoOfKM(23, 20);
            //mercedes2.ShowRemainingNoOfKM(10, 7);
            //double nrOfKMLeft = mercedes4.ShowRemainingNoOfKM(10,7);
            //Console.WriteLine("Remind km=" + nrOfKMLeft);
            //Console.WriteLine(FIZBUZ.ShowFizBuz(15));
            //
            //Tema Curs 2
            //Exercitiul 1
            Mercedes mercedes1 = new Mercedes();

            //mercedes1.StartEngine();

            //Exercitiul 2
            //metoda nu calculeaza corect deoarece la impartirea: noOfFuelLiters / Consumption
            //se ia intregul impartirii si iqnora partea fractionara
            //acest lucru se intampla deoarece noi lucram cu valori int
            //mercedes1.ShowRemainingNoOfKM(23, 20);
            //mercedes1.ShowRemainingNoOfKM(10, 7);

            //Exercitiul 3
            //metoda ShowRemainingNoOfKM inca nu functioneaza corect, datorita impartirii mentionate mai sus
            Console.WriteLine(mercedes1.StartEngine());
            Console.WriteLine("Remaining km: " + mercedes1.ShowRemainingNoOfKM(23, 20));
            Console.WriteLine("Remaining km: " + mercedes1.ShowRemainingNoOfKM(23, 20));

            //Exercitiul 4
            Console.WriteLine(mercedes1.StartEngine(20));

            //Ecercitiul 5
            Console.WriteLine("Consumption is: " + mercedes1.CalculateConsumption(8, 9, 0, 11));
            Console.WriteLine("Consumption is: " + mercedes1.CalculateConsumption(8, 9, -7, 11));
            Console.WriteLine("Consumption is: " + mercedes1.CalculateConsumption(8));

            Console.ReadKey();
        }