uses crt;
var
a,b,c,d,e,f:integer;
z:char;
procedure
persegi;
begin
write('Masukkan
panjang : ');readln(a);
write('Masukkan
lebar : ');readln(b);
c:=a*b;
write('Luas
Persegi Panjang : ',c);writeln;
for d:=1 to a do
write('*');writeln;
for e:=1 to b do
begin
write('*');
end;
end;
procedure
segitiga;
begin
write('Masukkan
Tinggi : ');readln(d);
write('Masukkan
Karakter : ');readln(z);
for a:=1 to d do
begin
for b:=d downto
a-1 do write(' ');
for b:= 2*a-1
downto 1 do write(z);writeln;
end;
end;
procedure
Pembuat;
begin
write('Feliks
Abedyoga Chandra Parapat - 672011158');writeln;
end;
procedure genjil;
begin
write('Masukkan
angka : ');readln(a);
if(a mod 2=0 )
then begin write(a,' ','Bilangan genap');
end else
write(a,'Bilangan ganjil');
end;
procedure menu;
begin
if(f=1) then
begin clrscr;persegi;readln;end else
if(f=2) then
begin clrscr;segitiga;readln;
end else
if(f=3) then
begin clrscr;pembuat;readln;
end else
if(f=4) then
begin clrscr;genjil;readln;end
else if(f=5) then
begin exit;
end else menu;
end;
begin
clrscr;
writeln('1.
Persegi : ');
writeln('2.
Segitiga :');
writeln('3.
Pembuat :');
writeln('4. Genap
Ganjil :');
writeln('5.
Keluar :');
writeln('Masukkan
pilihan :');readln(f);
menu;
end.
0 komentar:
Posting Komentar