fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication41
  8. {
  9. class Book
  10. {
  11. public Book(string Autor, string Name, string Publish, int Printing, double Price)
  12. {
  13. this.Autor = Autor;
  14. this.Name = Name;
  15. this.Publish = Publish;
  16. this.Printing = Printing;
  17. this.Price = Price;
  18. }
  19.  
  20. public string Autor;
  21. public string Name;
  22. public string Publish;
  23. public int Printing;
  24. public double Price;
  25.  
  26. public String setAutor
  27. {
  28. set { this.Autor = value; }
  29. get { return this.Autor; }
  30. }
  31.  
  32. public String setName
  33. {
  34. set { this.Name = value; }
  35. get { return this.Name; }
  36. }
  37.  
  38. public String setPublish
  39. {
  40. set { this.Publish = value; }
  41. get { return this.Publish; }
  42. }
  43.  
  44. public Int32 setPrinting
  45. {
  46. set { this.Printing = value; }
  47. get { return this.Printing; }
  48. }
  49.  
  50. public Double setPrice
  51. {
  52. set { this.Price = value; }
  53. get { return this.Price; }
  54. }
  55.  
  56. }
  57.  
  58. class Lib
  59. {
  60. public Book[] arrLib = new Book[10];
  61.  
  62.  
  63. public int Length
  64. {
  65. get
  66. {
  67. return arrLib.Length;
  68. }
  69. }
  70.  
  71. public Book this[int index]
  72. {
  73. get
  74. {
  75. return arrLib[index];
  76. }
  77. set
  78. {
  79. arrLib[index] = value;
  80. }
  81. }
  82. public void showBook()
  83. {
  84. int Ind;
  85. Console.WriteLine("Введите номер книги для просмотра данных");
  86. Ind= (Convert.ToInt32(Console.ReadLine()))+1;
  87. Console.WriteLine("{0},{1},{2},{3},{4}", this.arrLib[Ind].Autor, this.arrLib[Ind].Name, this.arrLib[Ind].Publish, this.arrLib[Ind].Printing, this.arrLib[Ind].Price);
  88. }
  89. public void editBook()
  90. {
  91. string Temp;
  92. int TPrinting;
  93. double TPrice;
  94. int Ind;
  95. Console.WriteLine("Введите номер книги для редактирования");
  96. Ind = (Convert.ToInt32(Console.ReadLine())) + 1;
  97. Console.WriteLine("Автор");
  98. Temp = Console.ReadLine();
  99. this.arrLib[Ind].setAutor = Temp;
  100. Console.WriteLine("Имя");
  101. Temp = Console.ReadLine();
  102. this.arrLib[Ind].setName = Temp;
  103. Console.WriteLine("Издательство");
  104. Temp = Console.ReadLine();
  105. this.arrLib[Ind].setPublish = Temp;
  106. Console.WriteLine("Тираж");
  107. TPrinting = Convert.ToInt32(Console.ReadLine());
  108. this.arrLib[Ind].setPrinting = TPrinting;
  109. Console.WriteLine("Цена");
  110. TPrice = Convert.ToDouble(Console.ReadLine());
  111. this.arrLib[Ind].setPrice = TPrice;
  112. }
  113.  
  114. public double bookSum()
  115. {
  116. double Sum =0;
  117. for (int i =0; i < arrLib.Length;i++)
  118. {
  119. Sum = Sum + arrLib[i].Price;
  120. }
  121. return Sum;
  122. }
  123.  
  124.  
  125.  
  126.  
  127. }
  128.  
  129.  
  130.  
  131.  
  132.  
  133. }
  134.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
error CS5001: Program `prog.exe' does not contain a static `Main' method suitable for an entry point
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty