1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
#include <string>
#include <cmath>
#include <iomanip>
#include <iostream>
#include "header.h"
using namespace std;
int input() {
int dollar;
int change;
char decimal;
cout << "Input the total here: ";
cin >> dollar >> decimal >> change;
cout << endl;
return dollar, change;
}
int fee(int& dollar) {
int fee;
if (dollar < 100) {
fee = dollar - 5;
} else if (dollar > 100 < 500) {
fee = dollar - 15;
} else if (dollar > 500 < 1000) {
fee = dollar - 25;
}
return dollar;
}
void bills(int& dollar, int& hundreds, int& fifties, int& twenties, int& tens, int& fives, int& ones) {
int remainingAmount = 0;
hundreds = dollar / 100;
remainingAmount = dollar - hundreds * 100;
fifties = remainingAmount / 50;
remainingAmount -= fifties * 50;
twenties = remainingAmount / 20;
remainingAmount -= twenties * 20;
tens = remainingAmount / 10;
remainingAmount -= tens * 10;
fives = remainingAmount / 5;
remainingAmount -= fives * 5;
ones = remainingAmount;
}
void coins(int& change, int& quarters, int& dimes, int& nickles, int& pennies)
{
quarters = change / .25;
change -= quarters * .25;
dimes = change / .10;
change -= dimes * .10;
nickles = change / .5;
change -= nickles * .5;
pennies = change;
}
int display() {
string divider(24, '-');
string small(3, '-');
string med(8, '-');
//cout<<"Fee Price"<<fee<<endl;
cout << "Denominations dispensed: " << endl;
cout << divider << endl;
cout << setw(24) << "#" << setw(10) << "Amount" << endl;
cout << setw(25) << small
<< setw(10) << med << endl;
cout<<"Hundreds: "<<endl;
cout<<"Fifties: "<<endl;
cout<<"Twenties: "<<endl;
cout<<"Tens: "<<endl;
cout<<"Fives: "<<endl;
cout<<"One's: "<<endl;
cout<<"Quarters: "<<endl;
cout<<"Dimes: "<<endl;
cout<<"Nickles: "<<endl;
cout<<"Pennies: "<<endl;
return 0;
}
|