-
Lenguaje
Pascal
-
Descripción
Sean N estudiantes. Lea las cuatro notas de cada estudiante e imprima la nota definitiva de cada uno, sabiendo que la nota definitiva es igual a la suma de cuatro notas multiplicada por cien, divididas entre 4 y al resultado se le suma uno.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
program NotaDefinitivaDeNEstudiantes;
uses crt;
var i, n : integer;
var nota_1, nota_2, nota_3, nota_4, nota_definitiva : real;
begin
write ('Ingresa el valor de n: ');
readln (n);
for i:=1 to n do
begin
writeln ('PROCESO ', i);
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);
nota_definitiva := (nota_1+nota_2+nota_3+nota_4)*100/4+1;
writeln ('Valor de nota definitiva: ', nota_definitiva:0:6);
writeln;
end;
end.
uses crt;
var i, n : integer;
var nota_1, nota_2, nota_3, nota_4, nota_definitiva : real;
begin
write ('Ingresa el valor de n: ');
readln (n);
for i:=1 to n do
begin
writeln ('PROCESO ', i);
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);
nota_definitiva := (nota_1+nota_2+nota_3+nota_4)*100/4+1;
writeln ('Valor de nota definitiva: ', nota_definitiva:0:6);
writeln;
end;
end.