The illustration shows a code segment with the lines numbered from 44 through 88 and the annotations are as follows:
"account1.update( );
cout << "account1 after update:\n";
account1.output(cout);
account2 = account1;
cout << "account2:\n";
account2.output(cout);
return 0;
}"
"void BankAccount::set(int dollars, int cents, double rate)" annotated as "Definition of member function set."
"{
if ((dollars <0) || (cents <0) || (rate <0))
{
cout << "Illegal values for money or interest rate.\n";
return;
}
balance = dollars + 0.01*cents;
interestRate = rate;
}"
"void BankAccount::set(int dollars, double rate)" annotated as "Definition of member function set."
"{
if ((dollars <0) || (rate <0))
{
cout << "Illegal values for money or interest rate.\n";
return;
}
balance = dollars;
interestRate = rate;
}
void BankAccount::update( )
{"
"balance = balance + fraction(interestRate)*balance;" annotated as "In the definition of a member function, you call another member function like this."
"}
double BankAccount::fraction(double percentValue)
{
return (percentValue / 100.0);
}
double BankAccount::getBalance( )
{
return balance;
}"