示例#1
0
文件: BookShop.cs 项目: jechev/OOP
 static void Main(string[] args)
 {
     Book book=new Book("Pod Igoto","Ivan Vazov",19.99m);
     Console.WriteLine(book);
     GoldenEditionBook goldenBook=new GoldenEditionBook("Tutun","Dimitar Dimov",22.90m);
     Console.WriteLine(goldenBook);
 }
 static void Main()
 {
     Book book = new Book("Pod igoto","Ivan Vazov",15.90m);
     Console.WriteLine(book);
     Console.WriteLine();
     GoldenEditionBook goldBook = new GoldenEditionBook("Tutun","Dimitur Dimov",22.90m);
     Console.WriteLine(goldBook);
 }
示例#3
0
        static void Main()
        {
            var book = new Book("Pod Igoto", "Ivan Vazov", 15.90m);

            var goldenBook = new GoldenEditionBook("Tutun", "Dimitar Dimov", 22.90m);

            Console.WriteLine(book);
            Console.WriteLine(goldenBook);
        }
示例#4
0
        static void Main(string[] args)
        {
            Book book1 = new Book("Kama sutra", "Ne znam ot koi e", 60.00m);
            GoldenEditionBook goldenEd = new GoldenEditionBook("Qka kniga", "Ot men", 110.00m);

            Console.WriteLine(book1);
            Console.WriteLine();
            Console.WriteLine(goldenEd);
        }
示例#5
0
        static void Main(string[] args)
        {
            Book book1 = new Book("Kama sutra", "Ne znam ot koi e", 60.00m);
            GoldenEditionBook goldenEd = new GoldenEditionBook("Qka kniga", "Ot men", 110.00m);

            Console.WriteLine(book1);
            Console.WriteLine();
            Console.WriteLine(goldenEd);
        }
示例#6
0
文件: Program.cs 项目: Penkov/OOP
        static void Main(string[] args)
        {
            Book podigoto = new Book("Pod Igot", "Ivan Vazav", 35.0m);

            GoldenEditionBook perfe = new GoldenEditionBook("Perfe", "perfection", 5.0m);

            Console.WriteLine(podigoto.ToString());
            Console.WriteLine(perfe.ToString());
        }
示例#7
0
        static void Main(string[] args)
        {
            Book book = new Book("Pod Igoto", "Ivan Vazov", 15.90);

            Console.WriteLine(book);

            GoldenEditionBook goldbook = new GoldenEditionBook("Tutun", "Dimitar Dimov", 22.90);

            Console.WriteLine(goldbook);
        }
示例#8
0
        static void Main()
        {
            Book book = new Book("Be phenomenal or be forgotten", "Erick Thomas", 17.0);

            GoldenEditionBook goldenBook = new GoldenEditionBook("Be phenomenal or be forgotten", "Erick Thomas", 17.0);

            Book mixBook = new GoldenEditionBook("Be phenomenal or be forgotten", "Erick Thomas", 17.0);

            Console.WriteLine("{0}\n{1}\n{2}\n{3}",book,goldenBook,mixBook, mixBook as GoldenEditionBook);
        }
        static void Main()
        {
            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 + Environment.NewLine);
            Console.WriteLine(goldenEditionBook);
        }
        static void Main(string[] args)
        {
            string  author = Console.ReadLine();
            string  title  = Console.ReadLine();
            decimal price  = decimal.Parse(Console.ReadLine());

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

            Console.WriteLine(book);
            Console.WriteLine();
            Console.WriteLine(gBook);
        }
示例#11
0
        static void Main(string[] args)
        {
            string  author = Console.ReadLine();
            string  title  = Console.ReadLine();
            decimal price  = decimal.Parse(Console.ReadLine());

            try
            {
                GoldenEditionBook book = new GoldenEditionBook(title, author, price);
                Console.WriteLine(book.ToString());
            }
            catch (ArgumentException ae)
            {
                Console.WriteLine(ae.Message);
            }
        }
 static void Main(string[] args)
 {
     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 + Environment.NewLine);
         Console.WriteLine(goldenEditionBook);
     }
     catch (ArgumentException ae)
     {
         Console.WriteLine(ae.Message);
     }
 }
示例#13
0
        public static void Main()
        {
            try
            {
                string  author = Console.ReadLine();
                string  title  = Console.ReadLine();
                decimal price  = decimal.Parse(Console.ReadLine());

                Book book            = new Book(title, author, price);
                GoldenEditionBook gb = new GoldenEditionBook(title, author, price);
                Console.WriteLine(book + Environment.NewLine);
                Console.WriteLine(gb);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
示例#14
0
        public static void Main()
        {
            try
            {
                var author = Console.ReadLine();
                var title  = Console.ReadLine();
                var price  = decimal.Parse(Console.ReadLine());

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

                Console.WriteLine(book + Environment.NewLine);
                Console.WriteLine(goldenEditionBook);
            }
            catch (ArgumentException ae)
            {
                Console.WriteLine(ae.Message);
            }
        }
示例#15
0
        public static void Main(string[] args)
        {
            var author = Console.ReadLine();
            var title  = Console.ReadLine();
            var price  = decimal.Parse(Console.ReadLine());

            try
            {
                Book book = new Book(author, title, price);
                GoldenEditionBook goldenEdition = new GoldenEditionBook(author, title, price);

                Console.WriteLine(book + Environment.NewLine);
                Console.WriteLine(goldenEdition);
            }
            catch (Exception ae)
            {
                Console.WriteLine(ae.Message);
            }
        }
示例#16
0
        public static void Main()
        {
            try
            {
                string  author = Console.ReadLine();
                string  title  = Console.ReadLine();
                decimal price  = decimal.Parse(Console.ReadLine());

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

                Console.WriteLine(book);
                Console.WriteLine(goldenEditionBook);
            }
            catch (ArgumentException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
示例#17
0
文件: Program.cs 项目: AndrewTheM/OOP
        static void Main(string[] args)
        {
            try
            {
                string  author = Console.ReadLine();
                string  title  = Console.ReadLine();
                decimal price  = decimal.Parse(Console.ReadLine().Replace('.', ','));

                Book book = new Book(author, title, price);
                GoldenEditionBook goldenEditionBook = new GoldenEditionBook(author, title, price);
                Console.WriteLine(book + Environment.NewLine);
                Console.WriteLine(goldenEditionBook);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.ReadKey();
        }
示例#18
0
        private static void Main(string[] args)
        {
            var author = Console.ReadLine();
            var title  = Console.ReadLine();
            var price  = double.Parse(Console.ReadLine());

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

                Console.WriteLine(book);
                Console.WriteLine();
                Console.WriteLine(goldenEditionBook);
            }
            catch (ArgumentException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
示例#19
0
        static void Main()
        {
            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);
            }
        }
        public static void Main(string[] args)
        {
            string  author = Console.ReadLine();
            string  title  = Console.ReadLine();
            decimal price  = decimal.Parse(Console.ReadLine());

            try
            {
                Book book = new Book(title, author, price);
                Console.WriteLine(book.ToString() + Environment.NewLine);

                GoldenEditionBook goldenEditionBook = new GoldenEditionBook(title, author, price);
                Console.WriteLine(goldenEditionBook.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Environment.Exit(0);
            }
        }
示例#21
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);
            }
            catch (Exception)
            {
                Console.WriteLine("Title not valid!");
            }
        }