I cannot get the method to output the last lines, help?
Tried the nested if statments, for and do whiles, while is my new default
double cashpay = 0.00;
int doll = 0;
double quart = 0.0;
double dime = 0.0;
double nic = 0.0;
double penn = 0.0;
int c = 0;
cout << "Please input a number less than 5.00: ";
cin >> cashpay;
if (cashpay <= 5.00) {
while (c >= 0) {
while (c / 1 != 0) {
doll += 1;
c -= 1;
}
while (c / .25 != 0) {
quart += .25;
c -= .25;
}
while (c / .1 != 0) {
dime += .1;
c -= .1;
}
while (c / .05 != 0) {
nic += .05;
c -= .05;
}
while (c / .01 != 0) {
penn += 0.01;
c -= .01;
}
}
cout << " " << endl;
cout << doll << " dollars, ";
cout << quart << " quarters, ";
cout << dime << " dimes, ";
cout << nic << " nickles, and ";
cout << penn << " pennies " << endl;
} else {
cout << "Error. Please enter a number under 5.00" << endl;
}
only gives either the input and then possibly the greater than line, no more/less