I've issue to solving loop project - loan calculator need help. Question available in description. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I've issue to solving loop project - loan calculator need help. Question available in description.

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

14th Aug 2021, 1:37 PM
Prince Chouhan
Prince Chouhan - avatar
4 Answers
0
Check this one
14th Aug 2021, 2:09 PM
Prince Chouhan
Prince Chouhan - avatar
+ 5
Prince Chouhan , before we can help you, you should show us your attempt first. if you have not done a try by yourself upto now, please do so. Put your code in playground and link it here. thanks!
14th Aug 2021, 1:46 PM
Lothar
Lothar - avatar
+ 1
Lothar , check this code import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); //your code goes here int months= 3; for(int i= 0 ; i < months; i++) amount= amount *90/100; System.out.println(amount); } } }
14th Aug 2021, 1:47 PM
Prince Chouhan
Prince Chouhan - avatar
+ 1
Lothar Thanks i just solved it i did mistake Adding extra } ON THE PROGRAM
14th Aug 2021, 2:12 PM
Prince Chouhan
Prince Chouhan - avatar