25.03.2015 Views

Lista 02 - DCC/UFMG

Lista 02 - DCC/UFMG

Lista 02 - DCC/UFMG

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

program l2p37;<br />

var<br />

IDADE: integer;<br />

PESO, GOTAS: real;<br />

begin<br />

write('Digite o peso: ');<br />

readLn(PESO);<br />

write('Digite a idade: ');<br />

readLn(IDADE);<br />

GOTAS := 500 / 20; { calculo do numero de mg por gotas }<br />

if ( PESO < 5 ) then<br />

writeLn('Nao pode tomar o Remedio porque nao tem peso. Consulte medico.')<br />

else if ( IDADE >= 12 ) then<br />

if ( PESO >= 60 ) then<br />

writeLn('Tomar ',1000/GOTAS:3:2,' gotas')<br />

else<br />

writeLn('Tomar ', 875/GOTAS:3:2,' gotas')<br />

else if ( PESO

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!