title: C++ cashier code
body: <p><strong>The question:</strong></p>
  
  <blockquote>
    <p>Giving change. Implement a program that directs a cashier  how to give
    change. The program has two inputs: the  amount due and the amount
    received from the customer.  Display the dollars, quarters, dimes,
    nickels, and pennies  that the customer should receive in return.</p>
  </blockquote>
  
  <p><strong>What i have so far:</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  
  int main()
  {
  double amount_due;
  double amount_recieved;
  
  cout &lt;&lt; "Enter amount due: " &lt;&lt; endl;
  cin &gt;&gt; amount_due;
  cout &lt;&lt; "Enter amount received: ";
  cin &gt;&gt; amount_recieved;
  
  int change = amount_recieved - amount_due;
  int dollar = 100;
  int quarters = 25;
  int dimes = 10;
  int nickels = 5;
  int pennies = 1;
  
  
  
  //Return change in full dollars
  
  cout &lt;&lt; "dollars: " &lt;&lt; change % 100  &lt;&lt; endl;
  
  
  //Return change in quarters
  
  cout &lt;&lt; "quarters:  " &lt;&lt; (change % 100) % 25 &lt;&lt; endl;
  
  //Return change in dimes
  
  cout &lt;&lt; "dimes: " &lt;&lt; ((change % 100) % 25) % 10 &lt;&lt; endl;
  
  // Return change in nickels
  
  cout &lt;&lt; "nickels: " &lt;&lt; (((change % 100) % 25) % 10) % 5 &lt;&lt; endl;
  
  //Return change in pennies
  
  cout &lt;&lt; "pennies:  " &lt;&lt; ((((change % 100) % 25) % 10) % 5) % 1 &lt;&lt; endl;
  
  
  
  system("pause");
  return 0;
  
  }
  </code></pre>
  
  <p>I realize there are some other one of these answered but they may be to advanced to use in my code, what am i doing wrong?</p>