title: Getting pricing for tickets
body: <p>I am trying to make a simple java program, that calculates how much tickets would cost.
  1 adult ticket is 10$, a child cost 5$ but a family ticket (2 adults and 2 children) is 26$. An obvious saving
  So when input from the user, it needs to calculate how many family tickets (if applicable) and then pricing of items if they dont fit into a family bundle.</p>
  
  <p>I.e.</p>
  
  <ul>
  <li>Number of adults: 2</li>
  <li>Number of children: 4 </li>
  <li>Number of family tickets: 1</li>
  <li>Number of child tickets: 2</li>
  <li>Total cost: $36</li>
  </ul>
  
  <p>I cannot figure out the logic behind getting the pairings, comparing and taking out the extra items from both adults and children if needed. Here is what ive gotten so far:</p>
  
  <pre><code>        double adultPairs,childPairs;
          if (numberAdults &lt;= 1) { 
              adultPairs = 0;
          }
          else if (isEven(numberAdults)) { 
              adultPairs = numberAdults / 2; 
              adultTickets = 0;
          }
          else { 
              adultPairs = numberAdults / 2; 
              adultTickets = 1;
          }
  
          if (numberChildren &lt;= 1) { 
              childPairs = 0; 
          }
          else if (isEven(numberChildren)) { 
              childPairs = numberChildren / 2; 
              childTickets = 0;
          }
          else { 
              childPairs = numberChildren / 2;
              childTickets = 1;
          }
  </code></pre>