Explanation of the Solution | Outstanding Balance on the Credit Card
2. Katas
To see full version of Solution visit GitHub. See below↓
Solution:
- Create a function that takes three variables.
- Create a variable month for the calculation of months, with a value of 1, since we will start from the first month.
-
We pass to the main part of the program:
- We will use the cycle while to run through all the months (from 1 to 12).
- We consider the outstanding balance after one month and round each time to the second decimal point for a more accurate result.
- Display the line (by condition) and add to our variable month 1 to go to the next month.
- In the final part, we return a string that is given to us by condition.
That's all.
If you liked Katas, you can put star on this repositories, this will motivate me to write similar Katas for you.
Visit Github page: