-
Lenguaje
Pascal
-
Descripción
Pida tres notas de tres períodos respectivamente, luego calcule cuanto debe sacar un estudiante en el cuarto periodo para que su nota final sea mínimo de tres. Tenga en cuenta que para que un estudiante obtenga una nota final de tres la suma de los cuatro periodos anteriores debe ser de 12.
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
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
program NotasDe4Periodos;
uses crt;
var nota_1, nota_2, nota_3, nota_4_minima, suma : real;
begin
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);
suma := nota_1+nota_2+nota_3;
if suma<12 then
begin
nota_4_minima := 12-suma;
end
else
begin
nota_4_minima := 0;
end;
writeln ('Valor de nota 4 minima: ', nota_4_minima:0:6);
writeln ('Valor de suma: ', suma:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var nota_1, nota_2, nota_3, nota_4_minima, suma : real;
begin
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);
suma := nota_1+nota_2+nota_3;
if suma<12 then
begin
nota_4_minima := 12-suma;
end
else
begin
nota_4_minima := 0;
end;
writeln ('Valor de nota 4 minima: ', nota_4_minima:0:6);
writeln ('Valor de suma: ', suma:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.