Sie sind auf Seite 1von 3

F. T. E. S. M.

NOTA
FACULDADE DE ENGENHARIA SOUZA MARQUES
INFO II TS3 2 Sem/2016

Nome: Turma:
Arquivo: Micro:

1a. Questo: (3,0) pontos)

Construa o Fluxograma do programa descrito na 2 Questo.

2a. Questo: (7,0) pontos)

Desenvolva um programa para executar as tarefas abaixo:


a) .. Ler a Matrcula, o Nome, a 1 Nota e a 2 Nota dos alunos de uma turma que tem 5 alunos
..........................................................................................................................(1,5 pontos)
Matrcula ........... AA999 (cinco caracteres, sendo os dois primeiros letras e os demais
algarismos)
Nome ................. Mximo de 15 caracteres
Notas ................. de 0,0 a 10,0
b) .. Classificar os alunos em ordem alfabtica de Nome .....................................(2,5 pontos)
c) .. Calcular a Mdia Aritmtica (MED) ...............................................................(1,0 pontos)
d) .. Imprimir o cabealho do relatrio .................................................................(0,5 pontos)
e) .. Imprimir, na mesma linha, a Matrcula, o Nome, as duas notas e a Mdia
...........................................................................................................................(1,5 pontos)

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

Das könnte Ihnen auch gefallen