0_liprikon_0

Lab3 Объявление классов

Mar 21st, 2022
1,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.84 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. using System.Linq;
  4.  
  5. namespace Lab3
  6. {
  7.     class Passenger
  8.     {
  9.         private string Dep_point { get; set; }
  10.         public string DP
  11.         {
  12.             get { return Dep_point; }
  13.             set { Dep_point = value; }
  14.         }
  15.         private string Ar_point { get; set; }
  16.         public string AP
  17.         {
  18.             get { return Ar_point; }
  19.             set { Ar_point = value; }
  20.         }
  21.         private double Dep_time { get; set; }
  22.         public double DT
  23.         {
  24.             get { return Dep_time; }
  25.             set { Dep_time = value; }
  26.         }
  27.         private double Trav_time { get; set; } //время в пути
  28.         public double TT
  29.         {
  30.             get { return Trav_time; }
  31.             set { Trav_time = value; }
  32.         }
  33.         private double Ticket_cost { get; set; }
  34.         public double TC
  35.         {
  36.             get { return Ticket_cost; }
  37.             set { Ticket_cost = value; }
  38.         }
  39.         private string Seat_num { get; set; } //пример: 3F
  40.         public string SN
  41.         {
  42.             get { return Seat_num; }
  43.             set { Seat_num = value; }
  44.         }
  45.         private string Seat_class { get; set; }
  46.         public string SC
  47.         {
  48.             get { return Seat_class; }
  49.             set { Seat_class = value; }
  50.         }
  51.         private string Plane_kind { get; set; }
  52.         public string PK
  53.         {
  54.             get { return Plane_kind; }
  55.             set { Plane_kind = value; }
  56.         }
  57.         private string Airline { get; set; }
  58.         public string Line
  59.         {
  60.             get { return Airline; }
  61.             set { Airline = value; }
  62.         }
  63.         private bool Tickets { get; set; } //наличие билетов
  64.         public bool Ticket
  65.         {
  66.             get { return Tickets; }
  67.             set { Tickets = value; }
  68.         }
  69.         static List<Passenger>[] Pass = //ОШИБКА
  70.         {
  71.             new Passenger{Dep_point = "Moscow", Ar_point = "Paris", Dep_time = 12.20, Trav_time = 02.30, Ticket_cost = 4500.50, Seat_num = "14E", Seat_class = "Business", Plane_kind = "Boeing 777", Airline = "Aeroflot", Tickets = true},
  72.             new Passenger{Dep_point = "Bryansk", Ar_point = "Moscow", Dep_time = 08.00, Trav_time = 04.20, Ticket_cost = 5380.60, Seat_num = "35A", Seat_class = "Standart", Plane_kind = "Boeing 747", Airline = "Aeroflot", Tickets = false},
  73.             new Passenger{Dep_point = "Moscow", Ar_point = "Paris", Dep_time = 13.20, Trav_time = 02.30, Ticket_cost = 4500.50, Seat_num = "14E", Seat_class = "Business", Plane_kind = "Boeing 777", Airline = "Aeroflot", Tickets = false},
  74.             new Passenger{Dep_point = "Bryansk", Ar_point = "Moscow", Dep_time = 09.00, Trav_time = 04.20, Ticket_cost = 5380.60, Seat_num = "35A", Seat_class = "Standart", Plane_kind = "Boeing 747", Airline = "Aeroflot", Tickets = true },
  75.             new Passenger{Dep_point = "Moscow", Ar_point = "Paris", Dep_time = 14.20, Trav_time = 02.30, Ticket_cost = 4500.50, Seat_num = "14E", Seat_class = "Business", Plane_kind = "Boeing 777", Airline = "Aeroflot", Tickets = true},
  76.             new Passenger{Dep_point = "Bryansk", Ar_point = "Moscow", Dep_time = 10.00, Trav_time = 04.20, Ticket_cost = 5380.60, Seat_num = "35A", Seat_class = "Standart", Plane_kind = "Boeing 747", Airline = "Aeroflot", Tickets = false},
  77.             new Passenger{Dep_point = "Moscow", Ar_point = "Paris", Dep_time = 15.20, Trav_time = 02.30, Ticket_cost = 4500.50, Seat_num = "14E", Seat_class = "Business", Plane_kind = "Boeing 777", Airline = "Aeroflot", Tickets = false},
  78.             new Passenger{Dep_point = "Bryansk", Ar_point = "Moscow", Dep_time = 11.00, Trav_time = 04.20, Ticket_cost = 5380.60, Seat_num = "35A", Seat_class = "Standart", Plane_kind = "Boeing 747", Airline = "Aeroflot", Tickets = true}
  79.         };
  80.  
  81.     }
  82.    
  83. }
  84.  
Advertisement
Add Comment
Please, Sign In to add comment