-
Lenguaje
Java usando Scanner
-
Descripción
Se requiere pagar una comisión de 12% a los vendedores cuyas ventas sean mayores o iguales a 500000bs realizar un algoritmo que calcule el monto total a pagar.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.Scanner;
public class ComisionDel12AVendedores {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double comision, ventas;
System.out.print("Ingresa el valor de ventas: ");
ventas = in.nextDouble();
in.nextLine();
if(ventas>=500000)
comision=ventas*0.12;
else
comision=0;
System.out.println("Valor de comision: " + comision);
}
}
public class ComisionDel12AVendedores {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double comision, ventas;
System.out.print("Ingresa el valor de ventas: ");
ventas = in.nextDouble();
in.nextLine();
if(ventas>=500000)
comision=ventas*0.12;
else
comision=0;
System.out.println("Valor de comision: " + comision);
}
}