Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication22
  8. {
  9. class Books
  10. {
  11. public string author, title, price;
  12.  
  13. public Books(string a, string t, string p)
  14. {
  15. this.author = a;
  16. this.title = t;
  17. this.price = p;
  18. PrintBook();
  19. }
  20.  
  21. public void PrintBook()
  22. {
  23. Console.WriteLine("Автор: {0}\nНазвание: {1}\nЦена: {2}\n", author, title, price);
  24. }
  25.  
  26. }
  27.  
  28. class Program
  29. {
  30. static void Main(string[] args)
  31. {
  32. Books obj = new Books("Пушкин", "Руслан и Людмила","100");
  33. Console.ReadKey();
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement