title: How to use various calculations for various inputs
body: <p>I am writing a program that will let the user enter various types of information to calculate the expenses for a vacation trip.</p>
  <p>I am given the costs of three different forms of transportation, as well as four source cities and four destination cities.</p>
  <p>The three forms of travel are air, train and bus, while the source cities are Baltimore, Chattanooga, Nashville, and Pasadena. The destination cities are Denver, Madison, Clarksville, and Knoxville.</p>
  <p>I need to be able to calculate the cost to travel between each source and each destination city depending on what the user enters (form of travel, and each city).</p>
  <p>Now, my first guess was to write a very very long if/else if statement for each condition. I tried it and it doesn't seem to work either because it is so long or maybe I messed up somewhere.</p>
  <pre><code>if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 5000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 4000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 5000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 2500;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 2500;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 2000;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 2500;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 800;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 2000;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 1000;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 2000;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'B', 'b' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 2000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 2500;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 4000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 4000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 6000;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 500;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 2300;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 1600;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 2000;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 600;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 1300;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 1400;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'C', 'c' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 1700;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 5000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 2500;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 4000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 4500;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 1500;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 900;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 1500;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 1700;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 1400;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 700;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 1000;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'N', 'n' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 1300;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 5000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 4500;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 3000;
  
      else if(transportation_type == 'A', 'a' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 4500;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 2000;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 1900;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 1200;
  
      else if(transportation_type == 'T', 't' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'C', 'c')
          transportation_price = 1700;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'D', 'd')
          transportation_price = 1400;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'M', 'm')
          transportation_price = 1300;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'K', 'k')
          transportation_price = 800;
  
      else if(transportation_type == 'B', 'b' &amp;&amp; src_city == 'P', 'p' &amp;&amp; dest_city == 'C', 'c');
          transportation_price = 1300;
  </code></pre>
  <p>I use chars to symbolize each city and form of transportation. This if/else if statement does not work, as in my output all it gives me is a value of $1300 despite what the user enters.</p>
  <p>Is there any way I can shorten this down? Or if I messed up somewhere can someone point it out for me?</p>
  <p>Any help is appreciated!</p>