static void Main(string[] args)
        {
            CoffieTableBook ctBook = new CoffieTableBook();

            ctBook.Author = "Stephen King";
            ctBook.ISBN   = 123456;
            ctBook.Title  = "The Shining";
            ctBook.Price  = 150.0;
            ctBook.Price  = 40.0;

            Book book = new Book();

            book.Author = "J.R.R. Tolkien";
            book.ISBN   = 456789;
            book.Title  = "The Lord of the Rings, The return of the King";
            book.Price  = 25.0;

            TextBook tBook = new TextBook();

            tBook.Author = "Tim Dams";
            tBook.ISBN   = 123789;
            tBook.Title  = "Zie Scherper";
            tBook.Price  = 0.0;
            tBook.Price  = 20.0;

            Console.WriteLine(ctBook);
            Console.WriteLine(tBook);
            Console.WriteLine(book);

            Console.WriteLine();

            Console.WriteLine(ctBook.Equals(book));
            book.ISBN = ctBook.ISBN;
            Console.WriteLine(ctBook.Equals(book));
            Console.WriteLine(book.Equals(ctBook));

            Book b = Book.Add(book, ctBook);

            Console.WriteLine(b);
        }
Example #2
0
        static void Main(string[] args)
        {
            Book            book            = new Book();
            CoffeeTableBook coffeeTableBook = new CoffeeTableBook();
            TextBook        textBook        = new TextBook();
            Test            test            = new Test();

            test.ISBN = 1;

            book.Price            = 30;
            coffeeTableBook.Price = 10;
            textBook.Price        = 30;

            book.ISBN            = 1;
            coffeeTableBook.ISBN = 2;
            textBook.ISBN        = 1;

            book.Author            = "jos";
            coffeeTableBook.Author = "fien";
            textBook.Author        = "jos";

            book.Title            = "how to program";
            coffeeTableBook.Title = "how to sing";
            textBook.Title        = "how to program";

            Book testbook = Book.TelOp(coffeeTableBook, book);

            Console.WriteLine($"{testbook.ISBN} and {testbook} are equal");

            if (book.Equals(textBook))
            {
                Console.WriteLine($"{textBook} and {book} are equal");
            }
            else
            {
                Console.WriteLine($"{textBook} and {book} are not equal");
            }
        }
        static void Main(string[] args)
        {
            Book boek1 = new Book();

            boek1.Title  = "The Shining";
            boek1.Author = "Stephen King";
            boek1.ISBN   = 05848152;
            boek1.Price  = 25;
            Book boek2 = new Book();

            boek2.Title  = "The Haunting of Hill House";
            boek2.Author = "Shirley Jackson";
            boek2.ISBN   = 05848153;
            boek2.Price  = 20;
            TextBook tb = new TextBook();

            tb.Title      = "Zie Scherp";
            tb.Author     = "Tim Dams";
            tb.ISBN       = 03449664;
            tb.Price      = 15;
            tb.GradeLevel = 4;
            CoffeeTableBook ctb = new CoffeeTableBook();

            ctb.Title  = "Vlaamse Primitieven";
            ctb.Author = "Johannes De Meester";
            ctb.ISBN   = 01134685;
            ctb.Price  = 85;

            Book omnibus = boek1 + boek2;

            Console.WriteLine(omnibus);
            Console.WriteLine(tb);
            Console.WriteLine(ctb);
            Console.WriteLine(tb.Equals(ctb));


            Console.ReadLine();
        }