title: Javascript, prompt box and confirm box
body: <p>new user here.
  Can anyone help me solve this question?
  Refer question here <a href="http://i.imgur.com/e8UbQfB.jpg" rel="nofollow">http://i.imgur.com/e8UbQfB.jpg</a></p>
  
  <p>This is what I manage to do so far, full of errors of course, is it correct if I use switch case? Or maybe I can use if...else statement?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  
  
  &lt;script type="text/javascript"&gt;
  
  
  var price;
  var weight = parseFloat(prompt("Enter amount of laundry: ", ""));
  var rate;
  switch (weight)
  {
  case 1:
    rate = weight &lt;= 10;
    price = 2.00;
    break;
  
   case 2:
    rate = weight &gt;= 10 &amp;&amp; weight &lt;= 20;
    price = 1.50;
    break;
  
  case 3:
     rate = weight &gt;= 20;
     price = 1.00;
     break;
  }
  
  var total = price * weight;
  
  
  alert
  (
  "\nWeight :    " + weight + 
  "\nRate   :    " + price + 
  "\nTotal  : RM " + total 
  );
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;/html&gt;`
  </code></pre>