Пример #1
0
 void ChooseCabin()
 {
     while (true)
     {
         Console.WriteLine("Choose type of cabin :");
         for (int i = 0; i < 3; i++)
         {
             Console.WriteLine("cabin " + (i + 1) + " :" + "seat number " + cabins[i].SeatNumber + "\n");
         }
         try
         {
             iter = Convert.ToInt32(Console.ReadLine());
             try
             {
                 cabin = cabins[iter - 1];
                 break;
             }
             catch (Exception) { Console.WriteLine("\nWrong answer, please try again\n"); }
         }
         catch (Exception) { Console.WriteLine("\nWrong answer, please try again\n"); }
     }
     Console.Clear();
 }
Пример #2
0
 public Rocket(Engine engine, Tank tank, Cabin cabin)
 {
     this.engine = engine;
     this.tank   = tank;
     this.cabin  = cabin;
 }