Пример #1
0
        static void Main(string[] args)
        {
            Book book = new Book();

            book.Input("C#", 2500);
            Console.WriteLine(book.Print());
        }
Пример #2
0
        static void Main(string[] args)
        {
            Author a1 = new Author("Misu")
            {
                BirthDate = new DateTime(1980, 10, 10),
                Email     = "email"
            };
            var varsta = a1.ComputeAge();

            Console.WriteLine($"Varsta lui {a1.Name} este:{varsta}");


            Author a2 = new Author("Ionescu")
            {
                BirthDate = new DateTime(2000, 10, 10)
            };
            var varstaIonescu = a2.ComputeAge();


            Book b1 = new Book
            {
                Name   = "Jungle Book",
                Author = a1,
                Year   = 1950,
                Price  = (decimal)9.95
            };

            Console.WriteLine(b1.Print());

            Console.ReadKey();
        }