program parameter; uses crt; procedure kotak(x1,y1,x2,y2:integer;latar,tulisan:byte); var i:integer; begin textcolor(tulisan);textbackground(latar); window(x1,y1,x2,y2);clrscr;window(1,1,80,25); gotoxy(x1,y1);write(chr(218)); gotoxy(x2,y1);write(#191); gotoxy(x2,y2);write(#217); gotoxy(x1,y2);write(#192); for i:=x1+1 to x2-1 do begin gotoxy(i,y1);write(#196);gotoxy(i,y2);write(#196); end; for i:=y1+1 to y2-1 do begin gotoxy(x2,i);write(#179);gotoxy(x1,i);write(#179); end; end; procedure garis(x1,x2,y:integer;latar,tulisan:byte); var i:integer; begin textcolor(tulisan);textbackground(latar); gotoxy(x1,y);write(#195); gotoxy(x2,y);write(#180); for i:=x1+1 to x2-1 do begin gotoxy(i,y);write(#196); end; end; procedure hitung_segitiga; var alas,tinggi,luas:real; begin kotak(25,8,55,15,BLUE,WHITE); gotoxy(30,9);write('PERHITUNGAN SEGITIGA'); garis(25,55,10,BLUE,WHITE); gotoxy(27,11);write('Panjang Alas : '); gotoxy(27,12);write('Tinggi : '); garis(25,55,13,BLUE,WHITE); gotoxy(27,14);write('Luas Segitiga : '); gotoxy(43,11);readln(alas); gotoxy(43,12);readln(tinggi); luas:=0.5*alas*tinggi; gotoxy(43,14);write(luas:6:2); readln; end; procedure hitung_balok; var p,l,t,v:real; begin kotak(25,8,55,12,RED,WHITE); gotoxy(27,8);write(#180'PERHITUNGAN VOLUME BALOK'#195); gotoxy(27,9); write('Panjang : '); gotoxy(27,10);write('Lebar : '); gotoxy(27,11);write('Tinggi : '); kotak(25,13,55,15,BLUE,WHITE); gotoxy(27,14);write('Volume Balok : '); textbackground(RED);textcolor(WHITE); gotoxy(42,9);readln(p); gotoxy(42,10);readln(l); gotoxy(42,11);readln(t); v:=p*l*t; textbackground(BLUE);textcolor(WHITE); gotoxy(42,14);write(v:0:2); readln; end; begin // program utama hitung_segitiga; hitung_balok; end.