0

Loan Calculator help

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++) amount= amount - (amount * 10 / 100); System.out.println(amount); } } this code is always one off the correct number

13th Feb 2021, 1:34 PM
Sparky
Sparky - avatar
1 Resposta
- 1
Sparky Just do this amount = amount * 90 / 100;
13th Feb 2021, 3:42 PM
A͢J
A͢J - avatar