The Way to Programming
The Way to Programming
Write a program that help a cashier how to give change. The program read two input: the amount due and the amount received.
then it will display the change …
#include#include using namespace std; int main() { float amount_due, amount_received, difference; int cents,q,d,n,p; cout << "Amount due: "; cin >> amount_due; cout << "Amount received: "; cin >> amount_received; if(amount_received
It's not complete, because it doesn't handle dollar bills, $5 bills, etc, but you can use the same math above to get those numbers (just put them above the q=cents/25; line).
Sign in to your account