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); Console.WriteLine(goldenEditionBook); } catch (ArgumentException ae) { Console.WriteLine(ae.Message); } }
static void Main() { Book readyPlayerOne = new Book("Ready Player One", "Ernest Cline", 16.90); Console.WriteLine(readyPlayerOne.ToString()); GoldenEditionBook fahrenheit = new GoldenEditionBook("Fahrenheit 451", "Ray Bradbury", 11.90); Console.WriteLine(fahrenheit.ToString()); }
public void Run() { try { this.author = Console.ReadLine(); this.title = Console.ReadLine(); bool isPrice = decimal.TryParse(Console.ReadLine(), out this.price); if (!isPrice) { throw new ArgumentException("Price not valid!"); } this.book = new Book(this.author, this.title, this.price); } catch (ArgumentException ae) { Console.WriteLine(ae.Message); return; } this.goldenEditionBook = new GoldenEditionBook(this.author, this.title, this.price); Console.WriteLine(this.book + Environment.NewLine); Console.WriteLine(this.goldenEditionBook); }
static void Main() { Book book = new Book("Pod Igoto", "Ivan Vazov", 15.90m); Console.WriteLine(book); GoldenEditionBook goldenBook = new GoldenEditionBook("Tutun", "Dimitar Dimov", 22.90m); Console.WriteLine(goldenBook); }
static void Main() { var podIgoto = new Book("Pod Igoto", "Ivan Vazov", 15.90); var tutun = new GoldenEditionBook("Tutun", "Dimitar Dimov", 29.77); Console.WriteLine("{0}\n\n{1}", podIgoto, tutun); }
static void Main(string[] args) { Book book = new Book("Title", "Bill Evans", 12.233); Console.WriteLine(book.ToString()); GoldenEditionBook book2 = new GoldenEditionBook("Title", "Bill Evans", 12.233); Console.WriteLine(book2.ToString()); }
static void Main() { var book = new Book("Pod Igoto", "Vazov", 15.6); var goldenBook = new GoldenEditionBook("Bai Ganio", "Konstantinov", 25); Console.WriteLine(book.ToString()); Console.WriteLine(goldenBook.ToString()); }
static void Main(string[] args) { var author = Console.ReadLine(); var title = Console.ReadLine(); var price = decimal.Parse(Console.ReadLine()); try { var book = new Book(title, author, price); var goldenBook = new GoldenEditionBook(title, author, price); Console.WriteLine(book.ToString()); Console.WriteLine(goldenBook.ToString()); } catch (ArgumentException ex) { Console.WriteLine(ex.Message); } }
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); } }
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.Write(Environment.NewLine); Console.WriteLine(goldenEditionBook); } catch (ArgumentException exception) { Console.WriteLine(exception.Message); } }
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 (Exception e) { Console.WriteLine(e.Message); } }
public static void Main() { try { string author = Console.ReadLine(); string title = Console.ReadLine(); decimal price = decimal.Parse(Console.ReadLine()); var book = new Book(title, author, price); Console.WriteLine(book); Console.WriteLine(); var goldenEditionBook = new GoldenEditionBook(title, author, price); Console.WriteLine(goldenEditionBook); } catch (ArgumentException argEx) { Console.WriteLine(argEx.Message); } }
public void Run() { string author = Console.ReadLine(); string title = Console.ReadLine(); decimal price = decimal.Parse(Console.ReadLine()); try { Book book = new Book(title, author, price); GoldenEditionBook goldenEditionBook = new GoldenEditionBook(title, author, price); Console.WriteLine(book + Environment.NewLine); Console.WriteLine(goldenEditionBook); } catch (ArgumentException ex) { Console.WriteLine(ex.Message); } }
public static void Main() { var author = Console.ReadLine(); var title = Console.ReadLine(); var price = decimal.Parse(Console.ReadLine()); try { 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 author = Console.ReadLine(); string title = Console.ReadLine(); decimal price = Decimal.Parse(Console.ReadLine()); try { Book book = new Book(author, title, price); GoldenEditionBook gBook = new GoldenEditionBook(author, title, price); Console.WriteLine(book); Console.WriteLine(gBook); } catch (ArgumentException ae) { Console.WriteLine(ae.Message); } }
public 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 (Exception ae) { Console.WriteLine(ae.Message); } }
private static void Task2() { 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 (Exception e) { Console.WriteLine(e.Message); } }
static void Main(string[] args) { var book = new GoldenEditionBook("Design...", "Anton", 10); Console.WriteLine(book); Cat cat = new Cat(true, "Mitzi", 4); Dog dog = new Dog(true, "Scharo", 6); Kitten kitten = new Kitten(false, "Moni", 2); Tomcat tomcat = new Tomcat(true, "Bojo", 3); cat.ProduceSound(); Console.WriteLine(cat); dog.ProduceSound(); Console.WriteLine(dog); kitten.ProduceSound(); Console.WriteLine(kitten); tomcat.ProduceSound(); Console.WriteLine(tomcat); }
public static void Main() { try { var author = Console.ReadLine(); var titel = Console.ReadLine(); var price = decimal.Parse(Console.ReadLine()); var normalBook = new Book(author, titel, price); var editionBook = new GoldenEditionBook(author, titel, price); Console.WriteLine(normalBook); Console.WriteLine(); Console.WriteLine(editionBook); } catch (ArgumentException ae) { Console.WriteLine(ae.Message); } }
static void Main(string[] args) { Book book = new Book(); GoldenEditionBook goldenEditionBook = new GoldenEditionBook(); var bookAuthor = Console.ReadLine(); var bookTitle = Console.ReadLine(); decimal bookPrice = decimal.Parse(Console.ReadLine()); try { goldenEditionBook = new GoldenEditionBook(bookAuthor, bookTitle, bookPrice); book = goldenEditionBook; } catch (ArgumentException argEx) { Console.WriteLine(argEx.Message); return; } Console.WriteLine(book + Environment.NewLine); Console.WriteLine(goldenEditionBook); }
static void Main(string[] args) { Console.WriteLine("Input Author:"); string author = Console.ReadLine(); Console.WriteLine("Input Title:"); string title = Console.ReadLine(); Console.WriteLine("Input Price:"); decimal price = decimal.Parse(Console.ReadLine()); try { Book book = new Book(title, author, price); Console.WriteLine(book); book = new GoldenEditionBook(title, author, price); Console.WriteLine(book); } catch (Exception x) { Console.WriteLine(x.Message); } Console.ReadKey(); }