-
Lenguaje
Java usando Scanner
-
Descripción
Ingrese el sueldo y las 3 ventas realizadas en el mes por un trabajador. Calcular el sueldo total a fin de mes, si la empresa reconoce el 10% sobre el total de las ventas realizadas.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.Scanner;
public class SueldoAFinDeMes {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double sueldo, sueldo_total, venta_1, venta_2, venta_3;
System.out.print("Ingresa el valor de sueldo: ");
sueldo = in.nextDouble();
in.nextLine();
System.out.print("Ingresa el valor de venta 1: ");
venta_1 = in.nextDouble();
in.nextLine();
System.out.print("Ingresa el valor de venta 2: ");
venta_2 = in.nextDouble();
in.nextLine();
System.out.print("Ingresa el valor de venta 3: ");
venta_3 = in.nextDouble();
in.nextLine();
sueldo_total=sueldo+(venta_1+venta_2+venta_3)*0.1;
System.out.println("Valor de sueldo total: " + sueldo_total);
}
}
public class SueldoAFinDeMes {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double sueldo, sueldo_total, venta_1, venta_2, venta_3;
System.out.print("Ingresa el valor de sueldo: ");
sueldo = in.nextDouble();
in.nextLine();
System.out.print("Ingresa el valor de venta 1: ");
venta_1 = in.nextDouble();
in.nextLine();
System.out.print("Ingresa el valor de venta 2: ");
venta_2 = in.nextDouble();
in.nextLine();
System.out.print("Ingresa el valor de venta 3: ");
venta_3 = in.nextDouble();
in.nextLine();
sueldo_total=sueldo+(venta_1+venta_2+venta_3)*0.1;
System.out.println("Valor de sueldo total: " + sueldo_total);
}
}