0

Java second project loan calculator

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 y=amount; y>70/100 ; y-=10/100){ int remain= amount *90/100; System .out.println (remain); } } } Why is this wrong?

6th Aug 2021, 10:18 PM
hagar
hagar - avatar
2 ответов
+ 3
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); int mes =1; int res=0; //tu código va aquí while(mes<=3) { res=amount*10/100; amount-=res; mes++; } System.out.println(amount); } } use while y aumente el valor de mes en cada interacción para que el bucle se repita 3 veces que es la cantidad de el mes
6th Aug 2021, 11:03 PM
Hans Farulla
Hans Farulla - avatar
0
Thank you ❤️😊
6th Aug 2021, 11:24 PM
hagar
hagar - avatar