I have this code that works and i am trying to do this:
You must add a function to your program called CalcInterest. This function will take as its ONLY parameter an Account, and return the Interest calculated as shown in Part 1. Your main program should now use this function instead
I have done all the previous parts but am really struggling with this part for hours! if someone could provide an example or show me how to do it i would be eternally greatful
> You must add a function to your program called CalcInterest.
> This function will take as its ONLY parameter an Account, and return the Interest calculated
> Your main program should now use this function instead
1 2 3 4 5 6 7 8
// ...
for ( int i = 0; i < MAXACCOUNTS; ++i )
{
std::cout << accounts[i].Number << " has a balance of " << accounts[i].Balance
<< ". The amount with interest is: "
<< accounts[i].Balance + CalcInterest( accounts[i] ) << '\n' ;
}
// ...