-
Lenguaje
Java usando Scanner
-
Descripción
Calcular comisión por venta. Si el vendedor tiene ventas:
- > 200000 7% del total de ventas.
- < 199000 2% del total.
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 ComisionPorVenta {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double comision, venta;
System.out.print("Ingresa el valor de venta: ");
venta = in.nextDouble();
in.nextLine();
if(venta>=200000)
comision=venta*0.07;
else
comision=venta*0.02;
System.out.println("Valor de comision: " + comision);
}
}
public class ComisionPorVenta {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double comision, venta;
System.out.print("Ingresa el valor de venta: ");
venta = in.nextDouble();
in.nextLine();
if(venta>=200000)
comision=venta*0.07;
else
comision=venta*0.02;
System.out.println("Valor de comision: " + comision);
}
}