• Lenguaje

    Pascal

  • Descripción

    Calcular el monto que debe pagar el socio de un club por derecho de pertenencia. Si es socio EXCLUSIVO pagará S/. 500.00, si es socio EJECUTIVO pagará S/. 300.00, y si es socio REGULAR pagará S/. 150.00. Si el socio tiene deuda, tendrá un recargo del 15% sobre el total de su deuda. En ningún caso el recargo será mayor de S/. 120.00 ni menor de S/. 30.00.

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
45
46
47
48
program SocioDeUnClub;
uses crt;

var tipo_de_socio : integer;
var deuda, monto_a_pagar, recargo, subtotal : real;
begin
    write ('Ingresa el valor de deuda: ');
    readln (deuda);
    subtotal := 0;
    writeln ('Selecciona el valor de tipo de socio.');
    writeln ('    1.- EXCLUSIVO');
    writeln ('    2.- EJECUTIVO');
    writeln ('    3.- REGULAR');
    write ('    : ');
    repeat
        readln (tipo_de_socio);
        if (tipo_de_socio<1) or (tipo_de_socio>3) then
            write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
    until (tipo_de_socio>=1) and (tipo_de_socio<=3);
    if tipo_de_socio=1 then
        begin
            subtotal := 500;
        end;
    if tipo_de_socio=2 then
        begin
            subtotal := 300;
        end;
    if tipo_de_socio=3 then
        begin
            subtotal := 150;
        end;
    recargo := deuda*0.15;
    if recargo>120 then
        begin
            recargo := 120;
        end;
    if (recargo>0) and (recargo<30) then
        begin
            recargo := 30;
        end;
    monto_a_pagar := subtotal+recargo;
    writeln ('Valor de monto a pagar: ', monto_a_pagar:0:6);
    writeln ('Valor de recargo: ', recargo:0:6);
    writeln ('Valor de subtotal: ', subtotal:0:6);
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.