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 Answers
+ 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;