
help!
Publicado por nicolas (1 intervención) el 14/05/2023 08:25:58
hello! I need to pass this code to function.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
nombre1 = input("ESCRIBA UN NOMBRE Y UN APELLIDO: ")
categoria= input ("INGRESE CATEGORIA:")
sueldo1 = float(input(f"INGRESE EL SALARIO DE {nombre1}: "))
antiguedad = int(input("INGRESE ANTIGUEDAD:"))
if categoria == "a" and antiguedad <= 10:
print ("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.05), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.05))
elif categoria == "a" and antiguedad >=10 and antiguedad <=15:
print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.10), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.10))
elif categoria == "a" and antiguedad >15:
print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.15), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.15))
elif categoria == "b" and antiguedad <= 10:
print ("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.10), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.10))
elif categoria == "b" and antiguedad >=10 and antiguedad <=15:
print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.15), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.15))
elif categoria == "b" and antiguedad >15:
print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.20), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.20))
if categoria == "c" and antiguedad <= 10:
print ("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.15), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.15))
elif categoria == "c" and antiguedad >=10 and antiguedad <=15:
print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.20), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.20))
elif categoria == "c" and antiguedad >15:
print("Sueldo anterior:" + str(sueldo1), "Aumento:" + str(sueldo1*0.25), "Sueldo actualizado:"+ str(sueldo1+sueldo1*0.25))
else:
print("error")
Valora esta pregunta


0