-
-
Save parzibyte/7fbe648209dc61e811c0f7449bc599d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# https://parzibyte.me/blog | |
echo "1. Operativo\n2. Administrativo\n3. Ejecutivo\nSeleccione tipo de empleado: "; | |
fscanf(STDIN, "%d", $tipoEmpleado); | |
if ($tipoEmpleado < 1 || $tipoEmpleado > 3) { | |
exit("Tipo de empleado inválido"); | |
} | |
echo "Ingrese la cantidad de horas trabajadas: "; | |
fscanf(STDIN, "%d", $horas); | |
switch ($tipoEmpleado) { | |
case 1: | |
$salario = 5.5 * $horas; | |
break; | |
case 2: | |
$salario = 10 * $horas; | |
break; | |
case 3: | |
$salario = 18.5 * $horas; | |
break; | |
} | |
echo "Su salario para esta quincena es: " . $salario . " dólares"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment