0

Please help me complete the Loan calculator problem in java. My code is below

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 x=1; x<=6; x++){ int percen= amount /10; int new= amount - percen System.out.println(new); } }

11th Jan 2021, 11:37 AM
Aditya Mukherjee
Aditya Mukherjee - avatar
2 Answers
+ 1
Aditya Mukherjee Take amount as double double amount = scanner.nextDouble(); for(int i = 0; i <= 6; i++) { amount = amount - Math.ceil(amount / 10); } System.out.println((int) amount);
11th Jan 2021, 12:10 PM
A͢J
A͢J - avatar
0
Thanks
12th Jan 2021, 5:08 PM
Aditya Mukherjee
Aditya Mukherjee - avatar