Advertisement
Guest User

Lesson 8 Activity 3 Joaquin

a guest
Dec 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5.     double x;
  6.     int y;
  7.     cout << " Enter the quantitiy: " << endl;
  8.     cin >> x;
  9.     y= x*100;
  10.    
  11.     cout << " You will need (" << y/10000 << ") 100 dollar bills";
  12.     cout << " (" << y/2000 << ") 20 dollar bills ";
  13.     y=y%2000;
  14.     cout << " (" << y/1000 << ") 10 dollar bills ";
  15.     y=y%1000;
  16.     cout << " (" << y/500 << ") 5 dollar bills ";
  17.     y=y%500;
  18.     cout << " (" << y/100 << ") 1 dollar bills ";
  19.     y=y%100;
  20.     cout << " and you will need " << y/25 << " Quaters " ;
  21.     y=y%25;
  22.     cout << " (" << y/10 << ") Dimes " ;
  23.     y=y%10;
  24.     cout << " (" << y/5 << ") Nickels " ;
  25.     y=y%5;
  26.     cout << " (" << y/1 << ") Pennies " ;
  27.     return 0;
  28.    
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement