+ 1

Need help with the loan calculator question.

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 = 0; int perc = 10/100; while (months < 7) { months = months + 1; if (months == 6) { int perDec = perc*amount; int amountLeft = amount - perDec; System.out.println(amountLeft); amount = amountLeft; } } } }

5th Jan 2021, 8:09 AM
Augustine Ansah Owusu
Augustine Ansah Owusu - avatar
3 Réponses
+ 2
What is your code supposed to do and what is your question?
5th Jan 2021, 8:12 AM
Makar Mikhalchenko
Makar Mikhalchenko - avatar
5th Jan 2021, 8:19 AM
JaScript
JaScript - avatar
0
Makar Mikhalchenko The amount input e.g 20000 suppose to output 10628 but my output is still the input i.e 20000
5th Jan 2021, 9:27 AM
Augustine Ansah Owusu
Augustine Ansah Owusu - avatar