+ 1

Im trying to solve the loan calculator olz help but dont give the answer

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int amount= sc.nextInt(); int ten = 10 ; int combine = amount/10 ; for(int x=amount;x<=20000;x=x*3) { System.out.println(combine); } for(int x=amount;x<=20000;x=x*3) { System.out.println(combine); } for(int x=amount;x<=20000;x=x*3) { System.out.println(combine); } } }

7th Mar 2022, 1:52 AM
Raja Velu
Raja Velu - avatar
3 Answers
+ 2
This is one of the coach tasks, and many had attempted to solve it. I suggest you to search the forum to get clues (perhaps even solution) 👍
7th Mar 2022, 2:37 AM
Ipang
+ 2
You need to reduce the amount by each payment and then calculate the next payment reduction using the reduced loan balance
7th Mar 2022, 3:41 AM
Paul K Sadler
Paul K Sadler - avatar
0
Each time you get 10% of loan you have to subtract that from the amount then you will get your correct answer
7th Mar 2022, 5:22 AM
Prajwal Patil