• C++ program that help a cashier how to give change.

    Miranda65M Member

    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 …

  • SapnaVishwas Member
    #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).

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
en_USEnglish