title: If else/switch Combination
body: <p>I don't know if,else/switch all that well and i don't know if you can combine them, i'm not sure if that's the case or i just did the brakets wrong, but i spent hours to find the issue and i can't find it.Here's the whole code just in case:</p>
  
  <pre><code>const Fanta = 250,Sprite = 250,Cola = 250,Dirol = 450,Snickers = 300,Lays = 800;
  var a = prompt("1:Fanta = 250, 2:Sprite = 250, 3:Coca Cola = 250, 4:Dirol = 450, 5:Snickers = 300, 6:Lays = 800");
  function math()
  {
      switch(a)
      {
          case 1:
  alert("You chose Fanta");
  var money = prompt("Put money in");
  alert("You put in " + money)
  if(money &gt;= 250)
  {
      alert("You just purchased a Fanta! Take back " + (money - Fanta));
  }
  default:
  {
  alert("Error! You didn't put in enough money")
  }
  }
      switch(a)
      {
          case 2:
  alert("You chose Sprite");
  var money = prompt("Put money in");
  alert("You put in " + money)
  if(money &gt;= 250)
  {
      alert("You just purchased a Sprite! Take back " + (money - Sprite));
  }
  else
  {
  alert("Error! You didn't put in enough money")
  }
  }
      switch(a)
      {
          case 3:
  alert("You chose Cola");
  var money = prompt("Put money in");
  alert("You put in " + money)
  if(money &gt;= 250)
  {
      alert("You just purchased a Coca Cola! Take back " + (money - Cola));
  }
  else
  {
  alert("Error! You didn't put in enough money")
  }
  }
      switch(a)
      {
          case 4:
  alert("You chose Dirol");
  var money = prompt("Put money in");
  alert("You put in " + money)
  if(money &gt;= 450)
  {
      alert("You just purchased a Dirol! Take back " + (money - Dirol));
  }
  else
  {
  alert("Error! You didn't put in enough money")
  }
  }
      switch(a)
      {
          case 5:
  alert("You chose Snickers");
  var money = prompt("Put money in");
  alert("You put in " + money);
  if(money &gt;= 300)
  {
      alert("You just purchased a Snickers! Take back " + (money - Snickers));
  }
  else
  {
  alert("Error! You didn't put in enough money")
  }
  }
      switch(a)
      {
          case 6:
  alert("You chose Lays");
  var money = prompt("Put money in");
  alert("You put in " + money)
  if(money &gt;= 800)
  {
      alert("You just purchased a Sprite! Take back " + (money - Lays));
  }
  else
  {
  alert("Error! You didn't put in enough money")
  }
  }
  }
  math();
  </code></pre>