Java Loan Calculator
Hello guys, I posted this question earlier, but it's not showing up, even in my questions sections, so maybe somehow it didn't get posted, so I will write it again" I want to complete the Loan calculator code project, but I am running into an error that I don't know how to solve. I don't know how to solve it because I thought what I wrote is an operation that Java can execute under these circumstances, but it seems like it cannot which is why I am stuck on this problem. The error is: /usercode/Program.java:18: error: not a statement amount - .9*amount; ^ 1 error Next I will write what the problem says and how I tried to solve it so you can see what I did. Problem: 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 Use a loop to calculate the payment and remaining amounts for each month. Also, use integers for amounts. My 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 while (x >= amount*.729) { System.out.println(amount); if (amount == .9*amount) { continue; } if (amount == .81*amount) { continue; } amount - .9*amount; } }