im having some trouble completing one of my assignments for my intro coding class. i keep getting the error when compiling, "[Error] 'displayBills' was not declared in this scope. I will attach my code, any suggestions would be greatly appreciated, Thanks!
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int dollars;
cout << "Please enter the whole dollar amount (no cents!). Input 0 to terminate: ";
cin >> dollars;
while (dollars != 0)
{
displayBills(dollars);
cout << "Please enter the a whole dollar amount (no cents!). Input 0 to terminate: ";
cin >> dollars;
}
return 0;
}
displayBills(int dollars)
{
int ones;
int fives;
int tens;
int twenties;
int temp;
twenties = dollars / 20;
temp = dollars % 20;
tens = temp / 10;
temp = temp % 10;
fives = temp / 5;
ones = temp % 5;
cout << "The dollar amount of ", dollars, " can be represented by the following monetary denominations";
cout << " Twenties: " << twenties;
cout << " Tens: " << tens;
cout << " Fives: " << fives;
cout << " Ones: " << ones;
}