title: Cashier function doesn't work for specific cases
body: <p>This is my first time posting here, so if the code is too long, I'll be more than happy to edit it.</p>
  
  <p>I'm making a cashier, a function that makes change. </p>
  
  <p>The odd thing is:
  If I buy 1.14 for 1.15, I get a penny back.
  But if I buy .14 for .15 I get no pennies back.</p>
  
  <p>Also, if I buy .15 for .20, I get a nickel back.
  But if I buy .20 for .25, I get 4 pennies back. I need help understanding why I'm getting four pennies back instead of 0 pennies and 1 nickel like I'm supposed to. I believe something has to be wrong with the division somewhere.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  
  using namespace std;
  
  int main() {
  
    double buyAmount = 0.0;
    double paidAmount = 0.0;
    double diffAmount = 0.0;
    double smallChange = 0.0;
    int dollars = 0;
    int quarters = 0;
    int dimes = 0;
    int nickels = 0;
    int pennies = 0;
  
    cout &lt;&lt; "Enter purchase amount: ";
    cin &gt;&gt; buyAmount;
    cout &lt;&lt; endl;
  
    cout &lt;&lt; "Enter paid amount: ";
    cin &gt;&gt; paidAmount;
    cout &lt;&lt; endl;
  
    diffAmount = paidAmount - buyAmount;
  
    if (diffAmount &lt; 0 ) {
       cout &lt;&lt; "Error: Make sure paid amount exceeds purchase amount. ";
       cout &lt;&lt; endl;
    }
  
    dollars = floor(diffAmount);
    smallChange = (diffAmount - dollars) * 100  
  
    quarters = (smallChange / 25);
    smallChange = smallChange - (quarters * 25);
    dimes = (smallChange / 10);
    smallChange = smallChange - (dimes * 10);
    nickels = floor(smallChange / 5);
    smallChange = smallChange - (nickels * 5);
    pennies = floor(smallChange / 1); 
  
    cout &lt;&lt; "Total Change: $" &lt;&lt; diffAmount;
    cout &lt;&lt; endl &lt;&lt; endl;
    cout &lt;&lt; "dollars " &lt;&lt; dollars &lt;&lt; endl;
    cout &lt;&lt; "quarters " &lt;&lt; quarters &lt;&lt; endl;
    cout &lt;&lt; "dimes " &lt;&lt; dimes &lt;&lt; endl;
    cout &lt;&lt; "nickels " &lt;&lt; nickels &lt;&lt; endl;
    cout &lt;&lt; "pennies " &lt;&lt; pennies &lt;&lt; endl;
  }
  </code></pre>