title: Case statement - Ruby
body: <p>I'm writing a simple method which counts how much I need to pay for renting a car.
  However when I execute it, it always return else statement &quot;nothing&quot; . What is wrong here ?</p>
  <pre><code>def rental_car_cost(d)
      case d 
        when  d &lt; 3 
          puts d * 40 
        when  d &gt;=3  &amp;&amp;  d &lt; 7 
          puts d * 40 - 20 
        when  d &gt;= 7 
          puts d * 40 - 50
        else
          puts &quot;nothing&quot;
      end
  end
  
  rental_car_cost(5)
  
  nothing
  </code></pre>