Hacer un algoritmo que calcule el sueldo neto de 10 trabajadores aplicando las deducciones correspondientes.
Pseudocodigo.
1. Inicio
2. C, N, Dto, Ht = 0 Ph = o Sb = 0 AFP = 1.5 % ARS = 2.3 % Sn = 0 Cont = 0
3. Leer C, N, Dto, Ht, Ph
4. Cont = Cont + 1
5. Sb = ( Ht x Ph )
6. AFP = ( AFP x Sb )
7. ARS = ( ARS x Sb)
8. Sn = Sb - AFP - ARS
9. Si Cont = 10
10. Imprimir C, N Dto, Sb, Sn, AFP, ARS
11. Finalizar
12. De lo contrario ir al paso 3
Prueba de escritorio.
|
N |
C |
Dto |
Ht |
Ph |
Sb |
AFP |
ARS |
Sn |
Cont |
|
|
0 |
|
0 |
0 |
0 |
1.5% |
2.3% |
0 |
0 |
|
Ana |
7236463 |
Finanzas |
4 |
500 |
2000 |
1.5% x 2000 = 30
|
2.3% x 2000 = 46
|
1924 |
0 + 1 = 1
|
|
José |
3489563 |
Salud |
4 |
300 |
1200 |
1.5% x 1200 = 18
|
2.3% x 1200 = 27.6 |
1154.4 |
1 + 1 = 2
|
|
Laura |
8382747 |
Comercial
|
8 |
1000 |
8000 |
1.5% x 8000 =
120 |
2.3% x 8000 = 184 |
7696 |
2 + 1 = 3
|
|
Carlos |
1675476 |
Marketing
|
6 |
400 |
2400 |
1.5% x 2400 = 36
|
2.3% x 2400 = 55.2 |
2308.8 |
3 + 1 = 4
|
|
Juana |
9410834 |
Directivo
|
5 |
300 |
1500 |
1.5% x 1500 = 22.5 |
2.3% x 1500 = 34.5 |
1443 |
4 + 1 = 5
|
|
Miguel |
1043784 |
Compras |
7 |
800 |
5600 |
1.5% x 5600 = 84
|
2.3% x 5600 = 128 |
5388 |
5 + 1 = 6
|
|
Luisa |
2435457 |
Gestión |
2 |
200 |
400 |
1.5% x 400 = 6 |
2.3% x 400 = 9.2
|
384.8 |
6 + 1 = 7
|
|
Mario |
4589676 |
Producción
|
9 |
1000 |
9000 |
1.5% x 9000 =
135 |
2.3% x 9000 = 207 |
8658 |
7 + 1 = 8
|
|
Valeria |
6983457 |
Almacén |
6 |
700 |
4200 |
1.5% x 4200 = 60
|
2.3% x 4200 = 96.6 |
4043.4 |
8 + 1 = 9
|
|
David |
5473745 |
Producción
|
4 |
800 |
3200 |
1.5% x 3200 = 48
|
2.3% x 3200 = 73.6 |
3078.4 |
9 + 1 = 10 |
Diagrama de flujo.

No hay comentarios.:
Publicar un comentario