-
Lenguaje
Java usando Scanner
-
Descripción
Una persona desea saber cuánto debe pagar de interés por un préstamo que recibió de $50,500, si la tasa de interés del banco es del 27% anual.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import java.util.Scanner;
public class PrestamoDe50500 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double annos, interes, prestamo;
System.out.print("Ingresa el valor de annos: ");
annos = in.nextDouble();
in.nextLine();
prestamo=50500.0;
interes=prestamo*Math.pow(1.27,annos)-prestamo;
System.out.println("Valor de interes: " + interes);
System.out.println("Valor de prestamo: " + prestamo);
}
}
public class PrestamoDe50500 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double annos, interes, prestamo;
System.out.print("Ingresa el valor de annos: ");
annos = in.nextDouble();
in.nextLine();
prestamo=50500.0;
interes=prestamo*Math.pow(1.27,annos)-prestamo;
System.out.println("Valor de interes: " + interes);
System.out.println("Valor de prestamo: " + prestamo);
}
}