0

Java loan calculator q

Hello, my code is here 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 for(int i = 0; i < 3; i++) { amount = amount - (amount*10)/100; } System.out.print(amount); } } It passes test cases 1-4 but not test case 5. I don’t know what fails for test case 5 because the test case is hidden. Any hints what’s wrong or maybe there’s a boundary to check?

12th Jan 2022, 6:22 PM
Geoffrey
Geoffrey - avatar
2 Answers
+ 6
I think your solution is also correct. Try submitting again.
13th Jan 2022, 1:43 AM
Simba
Simba - avatar
+ 2
Geoffrey Bolton do amount = amount * 90 / 100; Or do amount = amount - amount / 10;
12th Jan 2022, 6:58 PM
A͢J
A͢J - avatar