[go: up one dir, main page]

0% found this document useful (0 votes)
50 views3 pages

Programas Prontos - Turbo Pascal

The document contains multiple Pascal programs that perform different tasks. These include collecting user input for names and numbers, managing candidate registrations for a vestibular exam, concatenating names, and calculating student grades and results. Each program utilizes loops and conditionals to process data and display results to the user.

Uploaded by

Leomar Júnior
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views3 pages

Programas Prontos - Turbo Pascal

The document contains multiple Pascal programs that perform different tasks. These include collecting user input for names and numbers, managing candidate registrations for a vestibular exam, concatenating names, and calculating student grades and results. Each program utilizes loops and conditionals to process data and display results to the user.

Uploaded by

Leomar Júnior
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

program posicoes;

uses crt;
var n: array [1..5] of string;
var pos: integer;
begin
clrscr;
for pos:= 1 to 5 do
begin
writeln ('Dˆ um n£mero: ');
readln (n [pos]);
end;
for pos:= 5 downto 1 do
writeln ('o ', pos,' n£mero ‚ ',n[pos]);
readkey
end.

program dados_vest;
uses crt;
var idad,candt,candh, candm, candh18:real;
var sexo,insc: string;
begin
clrscr;
candt :=0 ;

Writeln('Cadstro de Inscri‡oes para o vestibular ');


Writeln( ' ');
Writeln( ' Para encerrar as inscri‡oes, forne‡a inscricao = 999 ');
Writeln( ' ' );

Write(' Forne‡a a inscri‡ao: ');


Readln(insc);

while insc <> '999' do


begin
writeln('Dˆ a idade do condidato(a) ');
readln(idad);
writeln ('‚ H ou M?');
readln (sexo) ;
if sexo ='H'
then candh:= candh+1
else candm:= candm+1;
if (idad > 18) and (sexo = 'H')
then candh18 := candh18+1;

Write( ' Dˆ a nova inscri‡ao: ');


Readln(insc);

end;
writeln ('O n£mero de mulheres ‚..................... ',candm:2:2);
writeln('O n£mero de homens ‚....................... ', candh:2:2);
writeln('O n£mero de homens maiores de 18 anos ‚.... ', candh18:2:2);
readkey;
end.

program ns;
uses crt;
var
i,j:integer;
no,so,nc:array[1..3] of string;
begin
clrscr;
for i:=1 to 3 do
begin
write ('de o nome');
readln (no [i]);
write (' de o sobrenome');
readln (so [i]);
end;
j:=3;
for i:= 1 to 3 do
begin
nc [i]:=no[i]+so[j];
j:=j-1;
end;
for i:= 1 to 3 do
writeln ('nome completo',nc[i]);
readkey;
end.

program boletim;
uses crt;
var vnome, vres: array [1..3] of string;
vmed, vn1, vn2, vf: array [1..3] of real;
pos: integer;
begin
clrscr;
for pos:= 1 to 3 do
begin
writeln('Dˆ o nome do aluno ',pos);
readln (vnome[pos]);
writeln ('Dˆ a nota 1 do aluno ', pos);
readln (vn1[pos]);
writeln ('Dˆ a nota 2 do aluno' ,pos);
readln (vn2[pos]);
writeln ('Dˆ o n£mero de faltas do aluno ', pos);
readln (vf[pos]);
vmed[pos]:= (vn1[pos]+ vn2[pos])/2;
writeln ('A m‚dia do aluno', pos,' ‚: ',vmed[pos]:2:2);
if (vmed[pos] >= 6) and (vf[pos] <= 25)
then vres[pos]:= 'Aprovado'
else vres[pos]:= 'Reprovado';
end;
writeln('');
writeln ('Boletim');
writeln ('--------');
writeln ('Nome N1 N2 Faltas Resultado');
for pos:= 1to 3 do
begin
writeln ('--------');
writeln (vnome[pos] ,' ',vn1[pos]:2:1 ,' ',vn2[pos]:2:1 , ' ',vres[pos]);
end;
readkey;
end.

You might also like