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?
2 Réponses
+ 6
I think your solution is also correct.
Try submitting again.
+ 2
Geoffrey Bolton
do
amount = amount * 90 / 100;
Or do
amount = amount - amount / 10;