-
Lenguaje
Pascal
-
Descripción
Los estudiantes de la escuela El Abecé realizan cuatro pruebas al año. Lea las notas obtenidas en cada una de las pruebas y, por cada estudiante, determine el promedio y la condición para cada estudiante (Aprobado o Reprobado).
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
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
program EscuelaElAbece;
uses crt;
var nota_1, nota_2, nota_3, nota_4, promedio : real;
var tecla_repetir : char;
begin
repeat
clrscr;
write ('Ingresa el valor de nota 1: ');
readln (nota_1);
write ('Ingresa el valor de nota 2: ');
readln (nota_2);
write ('Ingresa el valor de nota 3: ');
readln (nota_3);
write ('Ingresa el valor de nota 4: ');
readln (nota_4);
promedio := (nota_1+nota_2+nota_3+nota_4)/4;
if promedio>=7 then
begin
writeln ('Aprobado');
end
else
begin
writeln ('Reprobado');
end;
writeln ('Valor de promedio: ', promedio:0:6);
writeln;
write (#168'Deseas repetir el proceso? (S/N): ');
repeat
tecla_repetir := readkey;
until (tecla_repetir = 's') or (tecla_repetir = 'n') or (tecla_repetir = 'S') or (tecla_repetir = 'N');
until (tecla_repetir <> 's') and (tecla_repetir <> 'S');
end.
uses crt;
var nota_1, nota_2, nota_3, nota_4, promedio : real;
var tecla_repetir : char;
begin
repeat
clrscr;
write ('Ingresa el valor de nota 1: ');
readln (nota_1);
write ('Ingresa el valor de nota 2: ');
readln (nota_2);
write ('Ingresa el valor de nota 3: ');
readln (nota_3);
write ('Ingresa el valor de nota 4: ');
readln (nota_4);
promedio := (nota_1+nota_2+nota_3+nota_4)/4;
if promedio>=7 then
begin
writeln ('Aprobado');
end
else
begin
writeln ('Reprobado');
end;
writeln ('Valor de promedio: ', promedio:0:6);
writeln;
write (#168'Deseas repetir el proceso? (S/N): ');
repeat
tecla_repetir := readkey;
until (tecla_repetir = 's') or (tecla_repetir = 'n') or (tecla_repetir = 'S') or (tecla_repetir = 'N');
until (tecla_repetir <> 's') and (tecla_repetir <> 'S');
end.