nick name


I made this widget at MyFlashFetish.com.

Jumat, 09 April 2010

pascal (menu)



uses crt;
var pil,a,b,c,d,e,f,i,j,n:integer;
var nama,kelas,npm:string;
var
mat : array[1..2,1..2] of byte;
label awal;
begin
awal:
clrscr;
writeln('--MASUKAN PILIHAN ANDA--');
writeln(' OPSI :');
writeln(' 1. IDENTITIY');
writeln(' 2. DERET');
writeln(' 3. MATRIX');
writeln(' 4. GENAP & GANJIL');
writeln(' 5. EXIT');
writeln;
write('PILIHAN ANDA ADALAH :');readln(pil);
case pil of
1:begin
clrscr;
writeln('ANDA MEMILIH PILIHAN 1');writeln;
write('NAMA :');readln(nama);
write('KELAS :');readln(kelas);
write('NPM :');readln(npm);
clrscr;
writeln('IDENTITAS ANDA');writeln;
writeln('NAMA :',nama);
writeln('KELAS :',kelas);
writeln('NPM :',npm);
readln;
goto awal;
end;

2:begin
clrscr;
writeln('ANDA MEMILIH PILIHAN 2');writeln;
write('masukan jumlah deret:');readln(a);
writeln;
for b:= 1 to a do
begin
for c:= 1 to b do
write(c);
writeln;
end;
for d:= a-1 downto 1 do
begin
for e:= 1 to d do
write(e);
readln;
end;
goto awal;
end;

3:begin
clrscr;
writeln('ANDA MEMILIH PILIHAN 3');writeln;
writeln('Matrix 2x2');
writeln('----------');
for i := 1 to 2 do
begin
for j := 1 to 2 do
begin
write('matrix elemen [',i,'][',j,'] : ');
readln(mat[i][j]);
end;
writeln;
end;
writeln;
writeln('Matrixnya adalah');
writeln('----------------');
writeln;
for i:= 1 to 2 do
begin
for j:= 1 to 2 do
begin
write(' ',mat[i][j],' ');
end;
writeln;
writeln;
end;
readln;
goto awal;
end;

4:begin
clrscr;
writeln('ANDA MEMILIH PILIHAN 4');writeln;
writeln('masukan nilai : ');readln(n);
if n MOD 2=0 then
writeln('bilangan genap')
else
writeln('bilangan ganjil');
readln;
goto awal;
end;

5:begin
clrscr;
writeln('ANDA MEMILIH PILIHAN 5');writeln;
writeln('---THANK YOU---');
readln;
end;
end;
end.
readln;
end.

Tidak ada komentar:

Posting Komentar

Pages