title: Private method called error
body: <p>Have written a method; when I try to run it, I get the error: </p>
  
  <pre><code>NoMethodError: private method ‘subtotal’ called for 39.99:Float
  at top level    in grades.rb at line 9
  Program exited with code #1 after 0.04 seconds.
  </code></pre>
  
  <p>Following is the code:</p>
  
  <pre><code>def subtotal(qty = 1)
    return nil if self.to_f &lt;= 0 || qty.to_f &lt;= 0
    self.to_f * qty.to_f
  end
  
  book = 39.99
  car = 16789
  
  puts book.subtotal(3)
  puts car.subtotal
  puts car.subtotal(7)
  </code></pre>