-
Lenguaje
Pascal
-
Descripción
Un club cobra una cuota mensual a sus socios a quienes dividen en activo, familiar y cadete.
El socio activo para el valor es de $500, el familiar un 50 por ciento mas y el cadete 20 por ciento menos que el socio activo.
Se ingresa por teclado el numero de socio, el nombre y apellido, el tipo de socio "Activo, Familiar y Cadete".
Informar lo siguiente:
a) El numero de socio
b) El nombre del socio
c) Tipo de socio
d) Total a pagar
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
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
program CuotaDeUnClub;
uses crt;
var tipo_de_socio : integer;
var total_a_pagar : real;
var nombre, apellido : string;
begin
write ('Ingresa el nombre: ');
readln (nombre);
write ('Ingresa el apellido: ');
readln (apellido);
total_a_pagar := 500;
writeln ('Selecciona el valor de tipo de socio.');
writeln (' 1.- Activo');
writeln (' 2.- Familiar');
writeln (' 3.- Cadete');
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
writeln ('Activo');
total_a_pagar := total_a_pagar*1.5;
end;
if tipo_de_socio=2 then
begin
writeln ('Familiar');
total_a_pagar := total_a_pagar*1.5*1.2;
end;
if tipo_de_socio=3 then
begin
writeln ('Cadete');
end;
writeln ('Nombre: ', nombre);
writeln ('Apellido: ', apellido);
writeln ('Valor de total a pagar: ', total_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var tipo_de_socio : integer;
var total_a_pagar : real;
var nombre, apellido : string;
begin
write ('Ingresa el nombre: ');
readln (nombre);
write ('Ingresa el apellido: ');
readln (apellido);
total_a_pagar := 500;
writeln ('Selecciona el valor de tipo de socio.');
writeln (' 1.- Activo');
writeln (' 2.- Familiar');
writeln (' 3.- Cadete');
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
writeln ('Activo');
total_a_pagar := total_a_pagar*1.5;
end;
if tipo_de_socio=2 then
begin
writeln ('Familiar');
total_a_pagar := total_a_pagar*1.5*1.2;
end;
if tipo_de_socio=3 then
begin
writeln ('Cadete');
end;
writeln ('Nombre: ', nombre);
writeln ('Apellido: ', apellido);
writeln ('Valor de total a pagar: ', total_a_pagar:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.