title: C# executing specific code
body: <p>I was wondering if there's a possibility to execute a specific piece of code by the user when running the program (The program is command line interface). </p>
  
  <p>The program executes everything in order but that's not what I want.</p>
  
  <p>Here are two screenshots of how the program runs and the code behind it.</p>
  
  <p>[<img src="https://i.stack.imgur.com/8sXlZ.png" alt="Program while running">]</p>
  
  <pre><code>        // Read all the bookings between dates:
          Console.WriteLine("Input start date in the format yyyy-mm-dd");
          DateTime bookingStartDate = DateTime.Parse(Console.ReadLine());
          Console.WriteLine("Input end date in the format yyyy-mm-dd");
          DateTime bookingEndDate = DateTime.Parse(Console.ReadLine());
          DbBookings bookings = new DbBookings(bookingStartDate, bookingEndDate);
          foreach (DbBooking booking in bookings.Bookings)
          {
              Console.WriteLine("booking start date = " + booking.startDate);
              Console.WriteLine("booking end date = " + booking.endDate);
              Console.WriteLine("booking room No = " + booking.roomNo);
              Console.WriteLine("booking guest = " + booking.guestName);
              Console.WriteLine("booking guest phone No = " + booking.guestPhone);
              Console.WriteLine("booking cost = " + booking.cost);
          }
  
  
          //Create a new booking
          Console.WriteLine("Bed and breakfast create new booking");
  
          Console.WriteLine("Input start date in the format yyyy-mm-dd");
          DateTime startDate = DateTime.Parse(Console.ReadLine());
          Console.WriteLine("Input end date in the format yyyy-mm-dd");
          DateTime endDate = DateTime.Parse(Console.ReadLine());
          Console.WriteLine("What room?");
          int room = int.Parse(Console.ReadLine());
          Console.WriteLine("Customer Name");
          string name = Console.ReadLine();
          Console.WriteLine("Customer phone number");
          string phone = Console.ReadLine();
          double cost = (endDate.ToOADate() - startDate.ToOADate()) * 29;
  
          DbBooking newBooking = new DbBooking(
              startDate,
              startDate,
              room,
              name,
              phone,
              cost
              );
          Console.ReadLine();
  </code></pre>
  
  <p>What I want the program to do is to ask 2 questions, 'Do you want to read the bookings' and 'Do you want to add new booking' you would answer these to questions by typing '1' or '2'</p>