Update implemented toString function

This commit is contained in:
Lev
2021-06-12 19:33:24 -05:00
parent d09c87819a
commit 40750a8d28
3 changed files with 10 additions and 2 deletions

View File

@ -36,5 +36,12 @@ bool Wallet::containsCurrency(std::string type, double amount)
std::string Wallet::toString()
{
return "Oink!";
std::string s;
for(std::pair<std::string, double> pair : currencies)
{
std::string currency = pair.first;
double amount = pair.second;
s += currency + " : " + std::to_string(amount) + "\n";
}
return s;
}