Skip to content

Instantly share code, notes, and snippets.

@titandiaz
Last active May 25, 2016 05:29
Show Gist options
  • Save titandiaz/0fb8bf7b9071b71f592717ff1adbc4b0 to your computer and use it in GitHub Desktop.
Save titandiaz/0fb8bf7b9071b71f592717ff1adbc4b0 to your computer and use it in GitHub Desktop.
Calcular las comisiones de los empleados de la empresa según los domicilios
package yava;
import java.util.Scanner;
public class DomiciliosYava {
double [] sueldos= new double[3];
double [] domicilios= new double[sueldos.length];
int i;
Scanner leer= new Scanner(System.in);
double [] salarioFinal= new double[sueldos.length];
double [] comision= new double[sueldos.length];
double [] temp= new double[sueldos.length];
double valorComision;
public DomiciliosYava()
{
pago();
}
public void pago()
{
for(i=0; i<sueldos.length; i++)
{
System.out.println("Digite el sueldo del empleado: " + i);
sueldos[i]= leer.nextDouble();
System.out.println("Digite domicilios del empleado: " + i);
domicilios[i]= leer.nextInt();
if(domicilios[i]>312)
{
temp[i]=domicilios[i]-312;
}
}
System.out.println("Digite el valor de la comision ");
valorComision= leer.nextDouble();
for(i=0; i<sueldos.length; i++)
{
comision[i]= temp[i]*valorComision;
System.out.println("La comision del empleado "+ i +" es = "+ comision[i]);
salarioFinal[i]=comision[i]+sueldos[i];
System.out.println("El sueldo final del empleado "+ i +" es = "+salarioFinal[i]);
}
}
public static void main(String[] args) {
DomiciliosYava opc= new DomiciliosYava();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment