--------------------------------------------------------------------------------------------------------------------------
program Menentukan_Berat_Ideal;
{I.S. : User memasukkan berat badan dan tinggi badan}
{F.S. : Menampilkan keterangan berat badan ideal atu tidak ideal}
uses crt;
var
BB,TB,p1 : integer;
Bideal,p2 : real;
Keterangan : string;
begin
window(15,6,65,18);textbackground(green);clrscr;
gotoxy(9,2);write('Program Menentukan Berat Badan Ideal');
gotoxy(9,3);write('====================================');
//Memasukkan berat badan dan tinggi badan
gotoxy(14,5);write('Masukkan Berat Badan : ');readln(BB);
gotoxy(14,6);write('Masukkan Tinggi Badan : ');readln(TB);
//Menghitung berat badan ideal
p1 := TB - 100;
p2 := p1 * 0.1;
Bideal := p1 - p2;
//Menentukan keterangan berat ideal
gotoxy(14,7);write('---------------------------');
gotoxy(14,8);write('Berat Ideal : ',BIdeal:0:0);
if (BB <= BIdeal +2) and (BB >= BIdeal -2)
then
Keterangan := 'Ideal'
else
Keterangan := 'Tidak Ideal';
//Menampilkan keterangan berat ideal
gotoxy(14,9);write('Berat Badan Anda ',Keterangan,'!');
readln;
end.
--------------------------------------------------------------------------------------------------------------------------
Download Script :
catatan :
hargailah tulisan orang lain, jika anda mengcopy-paste harap cantumkan link sumber.
0 komentar