Beispiel #1
0
        public static void Main()

        {
            try

            {
                string author = Console.ReadLine();

                string title = Console.ReadLine();

                decimal price = decimal.Parse(Console.ReadLine());



                Book book = new Book(author, title, price);

                GoldenEditionBook goldenEditionBook = new GoldenEditionBook(author, title, price);



                Console.WriteLine(book);

                Console.WriteLine(goldenEditionBook);
            }

            catch (ArgumentException ae)

            {
                Console.WriteLine(ae.Message);
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            try
            {
                string author = Console.ReadLine();
                string title = Console.ReadLine();
                double price = double.Parse(Console.ReadLine());

                Book book = new Book(author, title, price);
                GoldenEditionBook goldenEditionBook = new GoldenEditionBook(author, title, price);

                Console.WriteLine(book);
                Console.WriteLine(goldenEditionBook);
            }
            catch (ArgumentException ae)
            {
                Console.WriteLine(ae.Message);
            }
        }