Program
ellinjuniarti;
uses wincrt;
var
pilih:byte;
procedure luas_balok; {awal
prosedur luas balok}
var
p,l,t,luas : integer;
ulang : char;
begin
repeat
clrscr;
gotoxy (13,2) ;
writeln('===========================================');
gotoxy (13,3) ; writeln('=
MENGHITUNG LUAS BALOK
=');
gotoxy (13,4) ;
writeln('===========================================');
gotoxy (13,6) ; write ('Masukkan nilai p= ');
readln (p);
gotoxy (13,7) ; write ('Masukkan nilai l= ');
readln (l);
gotoxy (13,8) ;write ('Masukkan nilai t= ');
readln (t);
luas:= 2*((p*l)+(p*t)+(l*t));
gotoxy (13,10);writeln ('Jadi, luas balok
adalah=',luas) ;
repeat
writeln;
write('Mau coba lagi? (Y/N): ');
readln(ulang);
until
(ulang='Y') or (ulang='y') or (ulang='N') or (ulang='n') ;
until
(ulang = 'N') or (ulang='n');
end ; {akhir prosedur luas
balok}
procedure luas_kubus; {awal
prosedur luas kubus}
var
s, luas : integer;
ulang : char;
begin
repeat
clrscr;
gotoxy (13,2) ;
writeln('===========================================');
gotoxy (13,3) ; writeln('=
MENGHITUNG LUAS KUBUS
=');
gotoxy (13,4) ;
writeln('===========================================');
gotoxy (13,6); write ('masukkan nilai s= ');
read (s);
luas:= s*s;
gotoxy (13,8); writeln ('Jadi, luas kubus
adalah=',luas) ;
repeat
writeln;
write('Mau coba lagi? (Y/N): ');
readln(ulang);
until
(ulang='Y') or (ulang='y') or (ulang='N') or (ulang='n') ;
until
(ulang = 'N') or (ulang='n');
end; {akhir dari prosedur
luas kubus}
procedure luas_lingkaran; {awal
prosedur luas lingkaran}
var
r,luas : real;
ulang : char;
begin
repeat
clrscr;
gotoxy (13,2) ;
writeln('============================================');
gotoxy (13,3) ; writeln('=
MENGHITUNG LUAS LINGKARAN =');
gotoxy (13,4) ;
writeln('============================================');
gotoxy (13,6);write ('masukkan nilai r: ');
read (r);
luas:= 3.14*r*r;
gotoxy (13,8);writeln ('Jadi, luas lingkaran
adalah=',luas) ;
repeat
writeln;
write('Mau coba lagi? (Y/N): ');
readln(ulang);
until
(ulang='Y') or (ulang='y') or (ulang='N') or (ulang='n') ;
until
(ulang = 'N') or (ulang='n');
end; {akhir dari prosedur
luas lingkaran}
{Program Utama}
begin
clrscr;
repeat
clrscr;
gotoxy (16,2);write('
=======================');
gotoxy (16,3);write(' =
M E N U =');
gotoxy (16,4);write('
=======================');
gotoxy (13,6);write('(1) Luas balok');
gotoxy (13,7);write('(2) Luas kubus');
gotoxy (13,8);write('(3) Luas
lingkaran');
gotoxy (13,9); write ('(4) Exit');
gotoxy (14,11);write ('Pilih [1..4]');
gotoxy (12,12);write('Masukkan pilihan
= ');readln(pilih);
if pilih=1 then
luas_balok
else
if pilih=2 then
luas_kubus
else
if pilih=3 then
luas_lingkaran ;
until pilih=4 ;
clrscr;
writeln;
writeln;
writeln('
Terima Kasih Sudah Memakai Program Ini
');
writeln('
Sampai Jumpa Lagi
');
writeln('
^_^
');
writeln;
writeln;
writeln('
# # # # ,
*** *** ');
writeln('
#;;;;;;;# , ,
* * * ');
writeln('
#;;;;;;;;;# ,
* * ');
writeln('
#;;;;;;;;;;;#
* * ');
writeln('
_____________ ,
* * ');
writeln('
|
* *
');
writeln('
|(@_@) v v v
* * ');
writeln('
() () v v
*
');
writeln('
(_)(_))) v
');
writeln('
___v________________v__
');
gotoxy (13,20); write
('==============================');
gotoxy (13,21); write ('= created by:
Ellin Juniarti =');
gotoxy (13,22); write ('=
06121408012 =');
gotoxy (13,23); write
('==============================');
end.
No comments:
Post a Comment