1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
string Bank::getCustomerTotalAssets(int cusNum)
{
int totalAmount = 0;
Customer c = getCustomerByCustomerNumber(cusNum);
for each(int aNum in c.accountNumbers)
{
Account a = getAccountByAccountNumber(aNum);
totalAmount += a.balance;
}
return "Total balance of this customer across all accounts: " + intToDollarString(totalAmount);
}
string Bank::listCustomersWithHoldingsAbove(int amount)
{
string result;
int totalAssets = 0;
result += padRight("Customer#", '.', 9) + " ";
result += padRight("Name", '.', 20) + " ";
result += padRight("Birthdate", '.', 12) + " ";
result += padRight("SS#", '.', 12) + "\n";
result += padRight("", '_', 9) + " ";
result += padRight("", '_', 20) + " ";
result += padRight("", '_', 12) + " ";
result += padRight("", '_', 12) + "\n";
result += padRight("", '_', 9) + " ";
result += padRight("", '_', 20) + " ";
result += padRight("", '_', 12) + " ";
result += padRight("", '_', 12) + "\n";
return result;
}
| |