Beruflich Dokumente
Kultur Dokumente
NOTA
FACULDADE DE ENGENHARIA SOUZA MARQUES
INFO II TS3 2 Sem/2016
Nome: Turma:
Arquivo: Micro:
TS3_2016_2_Folha.docx Pag. 1
INCIO
N
FORI=1TO5DO
S
DIGITEMAT[I],
NOME[I],N1[I],
N2[I]
MAT[I],NOME[I],
N1[I],N2[I]
FORI=1TO5DO
S
FORJ=I+1TO5DO
S
N
NOME[I]>NOME[J]?
NOME1=NOME[I]
NOME[I]=NOME[J]
NOME[J]=NOME1
MAT1=MAT[I]
MAT[I]=MAT[J]
MAT[J]=MAT1
NOTA1=N1[I]
N1[I]=N1[J]
N1[J]=N11
NOTA2=N2[I]
N2[I]=N2[J]
N2[J]=N21
N
FIM FORJ=ITO5DO
MED=(N1[I]+N2[I])/2
IMPRIMENOME[I],
N1[I],N2[I],MED[I]
Fluxo_TS3.vsdx
Program TS3_2016_2;
VAR
Matric, Nome: Array[1..5] of String;
Nota1, Nota2: Array [1..5] of Real;
Med, Not1, Not2: Real;
Nome1, Matric1: String;
I, J: Integer;
Begin
{Leitura de Dados -------------------}
For I:= 1 to 5 do
Begin
Write ('Digite Nome: ------->');
Readln (Nome[I]);
Write ('Digite Matric: ----->');
Readln (Matric[I]);
Write ('Digite Nota1: ------>');
Readln (Nota1[I]);
Write ('Digite Nota2: ------>');
Readln (Nota2[I]);
Writeln;
End;
{Ordenao -----------------------}
For I:= 1 to 5 do
For J:=I+1 to 5 do
If Nome[I]>Nome[J] then
Begin
Nome1:=Nome[I];
Nome[I]:=Nome[J];
Nome[J]:=Nome1;
Matric1:=Matric[I];
Matric[I]:=Matric[J];
Matric[J]:=Matric1;
Not1:=Nota1[I];
Nota1[I]:=Nota1[J];
Nota1[J]:=Not1;
Not2:=Nota2[I];
Nota2[I]:=Nota2[J];
Nota2[J]:=Not2;
End;
{---------------------------------}
{Clculos e Relatrio}
Writeln (' MAT. NOME N1 N2 MED.');
Writeln ('----- ---------- ---- ---- ----');
For I:= 1 to 5 do
Begin
Med:=((Nota1[I]+Nota2[I])/2);
Writeln(Matric[I]:5, ' - ', Nome[I]:10, ' - ',Nota1[I]:3:1,
' - ',Nota2[I]:3:1, ' - ', Med:3:1);
End;
End.
TS3_2016_2_Prog.docx