• Lenguaje

    Pascal

  • Descripción

    Acepte nombre, apellido, cédula y sueldo_b. Si este sueldo es mayor o igual a 20000, entonces descuente 8.5% de ISR, 7.5% de ARS y 6.5% de AFP, de lo contrario descuente un 7% de ISR , un 6% de ARS y un 5% de AFP, calcular el Total de descuento (TD=ISR+ARS+AFP), calcule el sueldo_N (SN=SB-TD) , imprima todas estas variables para 20 empleados.

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
program IsrErsYAfpPara20Empleados;
uses crt;

var i : integer;
var AFP, ARS, ISR, sueldo_b, sueldo_n : real;
var total_de_descuento : real;
var nombre, apellido, cedula : string;
begin
    for i:=1 to 20 do
    begin
        writeln ('PROCESO ', i);
        write ('Ingresa el nombre: ');
        readln (nombre);
        write ('Ingresa el apellido: ');
        readln (apellido);
        write ('Ingresa el cedula: ');
        readln (cedula);
        write ('Ingresa el valor de sueldo b: ');
        readln (sueldo_b);
        if sueldo_b>=20000 then
            begin
                ISR := sueldo_b*0.085;
                ARS := sueldo_b*0.075;
                AFP := sueldo_b*0.065;
            end
        else
            begin
                ISR := sueldo_b*0.07;
                ARS := sueldo_b*0.06;
                AFP := sueldo_b*0.05;
            end;
        total_de_descuento := ISR+ARS+AFP;
        sueldo_n := sueldo_b-total_de_descuento;
        writeln ('Nombre: ', nombre);
        writeln ('Apellido: ', apellido);
        writeln ('Cedula: ', cedula);
        writeln ('Valor de AFP: ', AFP:0:6);
        writeln ('Valor de ARS: ', ARS:0:6);
        writeln ('Valor de ISR: ', ISR:0:6);
        writeln ('Valor de sueldo n: ', sueldo_n:0:6);
        writeln ('Valor de total de descuento: ', total_de_descuento:0:6);
        writeln;
    end;
end.