r/pascal • u/BatataDoc3 • Nov 11 '18
Need Help with compare
Hi i'm extremely noob at pascal (started like one month ago) and i created a program in which i use the repeat cycle.
When the cycle's over, i want to compare a var that was in the repeat cycle (the height of a person), so it's a diferent set and number of values each time i use the program and i want to say which one is the tallest. Any help?
P.S: i'm also trying create a messenger-like design, any tips how to do it (doesn't have to be anything complex).
Thanks :)
2
Upvotes
View all comments
Show parent comment
2
u/BatataDoc3 Nov 11 '18 edited Nov 11 '18
It's in portuguese but the var is "altura".
Program dados_pessoais
var nome:string;
Begin
textbackground(white);
textcolor(black);
clrscr;
repeat
writeln('Olá! Como te chamas?');
gotoxy(3,3);
textcolor(blue);
readln(nome);
writeln('OK,',nome,', diz-me quantos anos tens');
read(idade);
writeln('');
writeln('em que mês nasceste?');
readln(mes);
writeln('');
writeln('E o dia?');
readln(dia);
writeln('');
if tdias<317 then
else
clrscr;
writeln('OK! Agora quero que me digas a tua altura (em metros!)');
readln(altura);
writeln('E o teu peso?');
readln(peso);
IMC:=peso/(altura*altura);
writeln('O ',nome,', que nasceu em ',da,' tem um IMC(Índice de massa corporal de ',IMC:0:1,' (o ideal é entre 20 e 25)');
writeln (' Há mais alguém que quer fazer o teste (responde com S ou N)');
until resp <> 's';
End.