-
Lenguaje
Pascal
-
Descripción
Determinar el importe a pagar por un alumno de un instituto cuya cuota tiene un porcentaje de descuento que se establece en la siguiente tabla y está en función al colegio de procedencia del alumno; asimismo los importes están exonerados de impuestos.
INSTITUTOS
Colegio | A (Pensión 450) | B (Pensión 800) | C (Pensión 950)
Nacional | 20 | 50 | 30
Particular | 14 | 15 | 17
Pida el colegio de procedencia, el instituto al que se desea postulary muestre la pensión con el descuento respectivo.
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
49
50
51
52
53
54
55
56
57
58
59
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
49
50
51
52
53
54
55
56
57
58
59
program CuotaPorAlumno2;
uses crt;
var colegio, instituto : integer;
var cuota, descuento, pension : real;
begin
write ('Ingresa el valor de cuota: ');
readln (cuota);
writeln ('Selecciona el valor de instituto.');
writeln (' 1.- Nacional');
writeln (' 2.- Particular');
write (' : ');
repeat
readln (instituto);
if (instituto<1) or (instituto>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (instituto>=1) and (instituto<=2);
writeln ('Selecciona el valor de colegio.');
writeln (' 1.- A');
writeln (' 2.- B');
writeln (' 3.- C');
write (' : ');
repeat
readln (colegio);
if (colegio<1) or (colegio>3) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (colegio>=1) and (colegio<=3);
descuento := 0;
if (instituto=1) and (colegio=1) then
begin
descuento := cuota*0.2;
end;
if (instituto=1) and (colegio=2) then
begin
descuento := cuota*0.5;
end;
if (instituto=1) and (colegio=3) then
begin
descuento := cuota*0.3;
end;
if (instituto=2) and (colegio=1) then
begin
descuento := cuota*0.14;
end;
if (instituto=2) and (colegio=2) then
begin
descuento := cuota*0.15;
end;
if (instituto=2) and (colegio=3) then
begin
descuento := cuota*0.17;
end;
pension := cuota-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de pension: ', pension:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var colegio, instituto : integer;
var cuota, descuento, pension : real;
begin
write ('Ingresa el valor de cuota: ');
readln (cuota);
writeln ('Selecciona el valor de instituto.');
writeln (' 1.- Nacional');
writeln (' 2.- Particular');
write (' : ');
repeat
readln (instituto);
if (instituto<1) or (instituto>2) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (instituto>=1) and (instituto<=2);
writeln ('Selecciona el valor de colegio.');
writeln (' 1.- A');
writeln (' 2.- B');
writeln (' 3.- C');
write (' : ');
repeat
readln (colegio);
if (colegio<1) or (colegio>3) then
write ('Valor incorrecto. Ingr'#130'salo nuevamente.: ');
until (colegio>=1) and (colegio<=3);
descuento := 0;
if (instituto=1) and (colegio=1) then
begin
descuento := cuota*0.2;
end;
if (instituto=1) and (colegio=2) then
begin
descuento := cuota*0.5;
end;
if (instituto=1) and (colegio=3) then
begin
descuento := cuota*0.3;
end;
if (instituto=2) and (colegio=1) then
begin
descuento := cuota*0.14;
end;
if (instituto=2) and (colegio=2) then
begin
descuento := cuota*0.15;
end;
if (instituto=2) and (colegio=3) then
begin
descuento := cuota*0.17;
end;
pension := cuota-descuento;
writeln ('Valor de descuento: ', descuento:0:6);
writeln ('Valor de pension: ', pension:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.