1º Programa: Contador

O código desenvolvido:

Program Contador ;
var x,i,p1,p2,p3,p4 :integer;
Begin
for x:=1 to 10 do
Begin

writeln('Escolhe um numero de 1 a 100:');

read (i);

if (i>=0) and (i<=25) then p1:=p1+1;
if (i>25) and (i<=50) then p2:=p2+1;
if (i>50) and (i<=75) then p3:=p3+1;
if (i>75) and (i<=100) then p4:=p4+1;
end;

writeln ('No intrevalo [0,25] existem', p1,'numeros');
writeln ('No intrevalo ]25,50] existem', p2,'numeros');
writeln ('No intrevalo ]50,75] existem', p3,'numeros');
writeln ('No intrevalo ]75,100] existem', p4,'numeros');
End.

 

2º Programa: Tabuada

Código desenvolvido:

Program Tabuada ;
var i,n:integer;
Begin
Repeat
Write ('Diga o numero:');
read (n);
For i:=1 to 10 do
writeln (n,'*', i ,'=', i*n);
until n=0;
End.

 

3º Programa: Notas

 

Código desenvolvido:

Program NotasSec;
var nota:integer;
Begin
Repeat
Writeln('Qual é a nota?');
read (nota);
case nota of
1..4:
Begin
writeln ('Muito Mau');
writeln ('Vai estudar!!!');
end;
5..9:
Begin
writeln ('Mau');
writeln ('Tens de estudar mais ainda!');
end;
10..13:
Begin
writeln ('Suficiente');
writeln ('Já está melhor continua a trabalha!');
end;
14..16:
Begin
writeln ('Bom');
writeln ('Bom trabalho!');
end;
17..20:
Begin
writeln ('Muito Bom');
writeln ('Espetacular!');
end;
else
writeln ('nota invalida')
end;
until nota=0;
End.

 

4º Programa: Média

 

Código desenvolvido:

Program Media ;
var i,nota,soma:integer;
Begin
writeln ('Escreve as tuas notas');
soma:=0;
for i:=1 to 6 do
Begin
write ('Nota',i,'=');
readln (nota);
soma:=soma+nota;
end;
writeln ('Media=',soma/6);

End.