Last active
March 16, 2016 18:06
-
-
Save jmramirezpro/76d79f8b701f3199f40e 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
/* | |
* Sueldo.c | |
* Ejercicios del Podcast Codigo Fuente - Programa 026 | |
* Realizar un programa que nos calcule el sueldo que le corresponde a un empleado | |
* de una empresa que cobra 30.000 euros brutos al año. Tendremos que realizar | |
* los cálculos en función de los siguientes criterios: | |
* a. Si lleva más de 10 años en la empresa se le aplica un aumento del 15%. | |
* b. Si lleva menos de 10 años pero más que 5 se le aplica un aumento del 8%. | |
* c. Si lleva menos de 5 años pero más que 3 se le aplica un aumento del 6%. | |
* d. Si lleva menos de 3 años se le aplica un aumento del 4%. | |
* Creado el 16 de mar. de 2016 | |
* Author: jmramirez | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
float importe, aumento; | |
int antiguedad; | |
importe = 30000; | |
printf("Introduce la antigüedad del trabajador: "); | |
scanf("%d",&antiguedad); | |
if (antiguedad>=10){ | |
aumento=importe*0.15; | |
} else if (antiguedad<10 && antiguedad>=5){ | |
aumento=importe*0.08; | |
} else if (antiguedad<5 && antiguedad>=3){ | |
aumento=importe*0.06; | |
}else{ | |
aumento=importe*0.04; | |
} | |
printf("El sueldo que le corresponde al trabajador es de %f €\n", (importe+aumento)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment