Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace КР_Шпилев
  7. {
  8. сlass abstract {vagon}()
  9. class s_vagon{
  10. public string type;
  11. {
  12. public s_vagon (string typ) {type = typ;}
  13. }
  14. }
  15. class p_vagon{
  16. public string type;
  17. public bool sv;
  18. public bool tv;
  19. public p_vagon (string typ, bool is_tv, bool is_sv) {type = typ; sv = is_sv; tv = is_tv;}
  20. }
  21. class station{
  22. public string Name;
  23. public int X;
  24. public int Y;
  25. public station (string Name, bool x, bool y) {this.Name = Name; X = x; Y = y;}
  26. }
  27. class train{
  28. public int Number;
  29. public vagon v;
  30. public string station_out;
  31. public string station_in;
  32. public int time_out;
  33. public int time_in;
  34. public train (string stat_out, string stat_in, int Number, p_vagon v, int time_out, int time_in)
  35. {station_out = stat_out; station_in = stat_in; this.v = v; this.time_out = time_out; this.time_in = time_in;}
  36. }
  37. public string client_out (){
  38. while (true){
  39. bool prov = false;
  40. Console.Writeline ("Выберите из списка желаемую станцию отправления")
  41. for (int i = 0, i <= station.Length, i++)
  42. Console.WriteLine(station[i].Name);
  43. string s = Console.ReadLine();
  44. for (int i = 0, i <= station.Length, i++)
  45. if (s == station[i].Name) {
  46. prov = true; break;
  47. }
  48. if (prov) {rerutn s; break;}
  49.  
  50. }
  51. }
  52. public string client_in (){
  53. while (true){
  54. bool prov = false;
  55. Console.Writeline ("Выберите из списка желаемую станцию отправления")
  56. for (int i = 0, i <= station.Length, i++)
  57. Console.WriteLine(station[i].Name);
  58. string s = Console.ReadLine();
  59. for (int i = 0, i <= station.Length, i++)
  60. if (s == station[i].Name) {
  61. prov = true; break;
  62. }
  63. if (prov) {return s; break;
  64.  
  65. }
  66. }
  67. public bool tv_p (){
  68. while (true) {
  69. Console.WriteLine ("Желаете ли вы в поездке пользоваться телевизором? Введите <<Да>>, если хотите и <<Нет>> в противном случае");
  70. string s = Console.ReadLine();
  71. if (s = "Да") {return true; break;}
  72. if (s = "Нет") {return false; break;}
  73. }
  74. }
  75. public bool sv_p (){
  76. while (true) {
  77. Console.WriteLine ("Желаете ли вы в поездке пользоваться телефонной связью? Введите <<Да>>, если хотите и <<Нет>> в противном случае");
  78. string s = Console.ReadLine();
  79. if (s = "Да") {return true; break;}
  80. if (s = "Нет") {return false; break;}
  81. }
  82. }
  83. public string station_out (
  84.  
  85.  
  86. class Program
  87. {
  88. static void Main(string[] args)
  89. {
  90. }
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement