+ 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; } } } }
3 Réponses
+ 2
What is your code supposed to do and what is your question?
+ 1
This will help you:
https://code.sololearn.com/c4YDCGscyg92/?ref=app
0
Makar Mikhalchenko The amount input e.g 20000 suppose to output 10628 but my output is still the input i.e 20000