Ad
  • Default User Avatar

    Thanks four your feedback. I didn't look at it in this way. :)

  • Custom User Avatar

    Even though it might look stupid to call CalculateYears() like this, would the following scenario work as expected?
    principal = 1000
    desiredPrincipal = 900

    The break at the end of the while loop can be removed and the while statement can be updated to make the loop easier to read and functionally more rich (i.e. also supporting the above scenario) in one go.

    Kind regards,
    Maurice