Beispiel #1
0
        static void Main(string[] args)
        {
            EngineStruct engine   = new EngineStruct();
            ICar         car      = new Mercedes();
            AbstractCar  car2     = new Mercedes();
            Mercedes     mercedes = new Mercedes();

            Mercedes.StartEngine();

            Mercedes m1 = new Mercedes();

            Console.WriteLine("Remaining km: " + m1.ShowRemainingNoOfKM(13, 8));

            Mercedes m2 = new Mercedes();

            m2.StartEngine(10);

            double km = m2.CalculateConsumption(10);

            Console.WriteLine(km);


            Console.WriteLine("Mercedes is " + mercedes.Description);
            Console.WriteLine("Mercedes costs " + mercedes.Price);

            Console.WriteLine("This is my first C# project!");
            Console.ReadKey();
        }
Beispiel #2
0
        // String Nume;
        // String Prenume;

        static void Main(string[] args)
        {
            // sbyte a = -127;

            // Exercise 1 course 2
            Console.WriteLine("This is my first C# project.");

            //AbstractCar aCar = new AbstractCar();

            //EngineStruct engine = new EngineStruct();

            //Exercise 6 course 2
            ICar        car  = new Mercedes();
            AbstractCar car2 = new Mercedes();

            // Exercise 7 slide 21 course 2
            Mercedes _mercedes = new Mercedes();

            Console.WriteLine("Mercedes is " + _mercedes.Description);
            Console.WriteLine("Mercedes costs " + _mercedes.Price);

            Console.WriteLine("Model " + _mercedes.Model);
            Console.WriteLine("Consum " + _mercedes.Consum);

            //Exercise 1 slide 10 course 3
            Mercedes.StartEngine();

            //Exercise 3 course 3
            Mercedes m1 = new Mercedes();

            m1.ShowRemainingNoOfKM(10, 7);

            //Exercise 2 course 3
            double numberOfKM = m1.ShowRemainingNoOfKM(10, 7);

            Console.WriteLine(numberOfKM);

            //Exercise 4 slide 19 course 3
            Mercedes m2 = new Mercedes();

            m2.StartEngine(4);

            // Exercise 4 slide 21 course 3
            double km = m2.CalculateConsumption(14);

            Console.WriteLine(km);

            Console.ReadKey();

            string fizbuz = FizBuz.ShowFizBuz(15);

            Console.WriteLine("fizbuz");

            PrintLogo();
            PrintLogo(1);
            PrintLogo2();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            // AbstractCar aCar = new AbstractCar(); Nu se poate instantia
            Mercedes     mercedes = new Mercedes();
            EngineStruct engine   = new EngineStruct();

            mercedes.StartEngine();
            mercedes.ShowRemainingNoOfKM(100, 50);
            ICar        car  = new Mercedes();
            AbstractCar car2 = new Mercedes();

            Console.WriteLine("This is my first application");
            Console.WriteLine("Mercedes is " + mercedes.Description);
            Console.WriteLine("Mercedes costs " + mercedes.Price);
            Console.WriteLine(mercedes.StartEngine(1000));
            Console.WriteLine("The consumption is " + mercedes.CalculateConsumption(12, 25, 35));
            Console.ReadKey();
        }
        // String Nume;
        // String Prenume;

        static void Main(string[] args)
        {
            // sbyte a = -127;

            // Exercise 1 course 2
            Console.WriteLine("This is my first C# project.");

            //AbstractCar aCar = new AbstractCar();

            //EngineStruct engine = new EngineStruct();

            //Exercise 6 course 2
            ICar        car  = new Mercedes();
            AbstractCar car2 = new Mercedes();

            // Exercise 7 slide 21 course 2
            Mercedes _mercedes = new Mercedes();

            Console.WriteLine("Mercedes is " + _mercedes.Description);
            Console.WriteLine("Mercedes costs " + _mercedes.Price);

            Console.WriteLine("Model " + _mercedes.Model);
            Console.WriteLine("Consum " + _mercedes.Consum);

            //Exercise 1 slide 10 course 3
            Mercedes.StartEngine();

            //Exercise 3 course 3
            Mercedes m1 = new Mercedes();

            m1.ShowRemainingNoOfKM(10, 7);

            //Exercise 2 course 3
            double numberOfKM = m1.ShowRemainingNoOfKM(10, 7);

            Console.WriteLine(numberOfKM);

            //Exercise 4 slide 19 course 3
            Mercedes m2 = new Mercedes();

            m2.StartEngine(4);

            // Exercise 4 slide 21 course 3
            double km = m2.CalculateConsumption(14);

            Console.WriteLine(km);

            string fizbuz = FizBuz.ShowFizBuz(15);

            Console.WriteLine("fizbuz");


            Fruit fruct = new Fruit();

            Console.WriteLine(fruct.GetCalories());

            Apple apple = new Apple();

            Console.WriteLine(apple.GetCalories());

            Orange orange = new Orange();

            Console.WriteLine(orange.GetCalories());

            Ionatan ionatan = new Ionatan();

            Console.WriteLine(ionatan.GetCalories());

            //Apple a = new Ionatan();
            //Console.WriteLine(a.GetCalories());

            //Ionatan i = new Ionatan();
            //Console.WriteLine(i.GetCalories());

            //Fruit f = new Ionatan();
            //Console.WriteLine(f.GetCalories());

            Apple       a      = new Apple();
            Ionatan     i      = new Ionatan();
            Fruit       f      = new Fruit();
            FruitBasket basket = new FruitBasket();

            basket.addFruct(a);
            basket.addFruct(i);
            basket.addFruct(f);
            basket.displayFruitCalories();

            Console.ReadKey();

            PrintLogo();
            PrintLogo(1);
            PrintLogo2();
        }