Loan Calculator Output
Hi, I can't seem to find exactly the answer to my problem in any of the other threads. I am trying to solve the Loan Calculator challenge for Java and my output is off by one number. Even if I sidestep it and decrease my answer by -1 it still says I'm doing it wrong. I assume I want to do the math differently but am not sure what exactly is the best way to do it using only integers and not a double as I need to decrease it by 10% each loop. My code is below. Thanks in advance! import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); for (int x = 1; x <= 6; x++) { int payment = amount / 10; amount = amount - payment; System.out.println(amount); } } }