0

Quién me ayuda con el cålculo de préstamo

Este es el código no sé dónde me equivoco int pago = 0; int c = 100; int p = 0; pago = amount ; //10%Mes for(int x = 1; x < 4; x++ ){ p = (( pago / 100)* 10 ); pago -= p ; } System.out.println (pago);

26th Oct 2021, 7:48 PM
Francier Ortiz Cabrera
Francier Ortiz Cabrera - avatar
3 Answers
0
Que error te da? De donde sale amount? No veo que lo tengas declarado en ningun sitio.
26th Oct 2021, 8:54 PM
Guillem Padilla
Guillem Padilla - avatar
0
Si es la entrada
26th Oct 2021, 10:59 PM
Francier Ortiz Cabrera
Francier Ortiz Cabrera - avatar
0
p = (int) (( pago / 100.0) *10 ); pago / 100 result should be double type because 810 / 100 = 8 as int but 810 / 100.0 = 8.10 as double After calculate convert back to (int) because p is int also if calculates are in method there should be return command
27th Oct 2021, 2:53 AM
zemiak