-
Lenguaje
Pascal
-
Descripción
En un colegio se desean realizar asignaciones de bonos estudiantiles y se realizaran teniendo en cuenta las siguientes especificaciones.
Bono general: 100000.
- Si el estudiante tiene de 0 a 5 años recibe el bono mas 30%.
- Si el estudiante tiene de 6 a 10 años recibe el bono mas 20%.
- Si el estudiante tiene de 11 a 15 años recibe el bono mas 10%.
- Si tiene de 16 en adelantre recibe el bono general.
El algoritmo deberia indicar el que le corresponde a cada uno e imprimir el nombre y el valor a recibir.
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
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
program AsignacionesDeBonosEstudiantiles;
uses crt;
var asignacion, bono_general, edad : real;
var nombre : string;
begin
write ('Ingresa el nombre: ');
readln (nombre);
write ('Ingresa el valor de edad: ');
readln (edad);
asignacion := 0;
bono_general := 100000;
if edad<6 then
begin
asignacion := bono_general*1.3;
end;
if (edad>=6) and (edad<11) then
begin
asignacion := bono_general*1.2;
end;
if (edad>=11) and (edad<16) then
begin
asignacion := bono_general*1.1;
end;
if edad>=16 then
begin
asignacion := bono_general;
end;
writeln ('Nombre: ', nombre);
writeln ('Valor de asignacion: ', asignacion:0:6);
writeln ('Valor de bono general: ', bono_general:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var asignacion, bono_general, edad : real;
var nombre : string;
begin
write ('Ingresa el nombre: ');
readln (nombre);
write ('Ingresa el valor de edad: ');
readln (edad);
asignacion := 0;
bono_general := 100000;
if edad<6 then
begin
asignacion := bono_general*1.3;
end;
if (edad>=6) and (edad<11) then
begin
asignacion := bono_general*1.2;
end;
if (edad>=11) and (edad<16) then
begin
asignacion := bono_general*1.1;
end;
if edad>=16 then
begin
asignacion := bono_general;
end;
writeln ('Nombre: ', nombre);
writeln ('Valor de asignacion: ', asignacion:0:6);
writeln ('Valor de bono general: ', bono_general:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.