+ 2

Please solve this or say me how to solve this?? IN JAVA 🚩

You take a loan from a friend and need to calculate how much you will owe him after 3 months. You are going to pay him back 10% of the remaining loan amount each month. Create a program that takes the loan amount as input, calculates and outputs the remaining amount after 3 months. Sample Input: 20000 Sample Output: 10628 Here is the monthly payment schedule: Month 1 Payment: 10% of 20000 = 2000 Remaining amount: 18000 Month 2 Payment: 10% of 18000 = 1800 Remaining amount: 16200 Month 3: Payment: 10% of 16200 = 1620 Remaining amount: 14580

19th Aug 2021, 12:48 PM
Suchismita
Suchismita - avatar
4 odpowiedzi
+ 4
Every month, if you pay 10% it remains the 90% First month: remainingAmount1 = amount * 0.9 Second month: remainingAmount2 = remainingAmount1 * 0.9 = amount * 0.9 * 0.9 And so on You can solve this using a loop or using Math.pow
19th Aug 2021, 12:56 PM
David García Prados
19th Aug 2021, 12:58 PM
Suchismita
Suchismita - avatar
+ 2
Ok
19th Aug 2021, 1:05 PM
Suchismita
Suchismita - avatar
- 3
Hi
20th Aug 2021, 2:34 PM
Yakub Matthew