kumpul disini..
program menu...
Contoh :
Program Calculator;
uses wincrt;
const
Kol = 10; kol2=35;
Var
x, y : longint;
Potonganharga : Longint;
Bil1,Bil2,Bil3,Pilih : Integer;
procedure masukkan;
begin
clrscr;
gotoxy(kol2,4);writeln('----------------------');
gotoxy(kol2,5);writeln(' Masukan Bilangan ');
gotoxy(kol2,6);writeln('----------------------');
gotoxy(kol2,7);writeln('Bilangan 1 : ');
gotoxy(kol2,;writeln('Bilangan 2 : ');
gotoxy(kol2,9);writeln('----------------------');
gotoxy(kol2,10);writeln('Hasil Operasi : ');
gotoxy(kol2,11);writeln('----------------------');
gotoxy(kol2+20,7);readln(bil1);
gotoxy(kol2+20,;readln(bil2);
end;
Procedure Tambah;
begin
masukkan;
bil3 := bil1 + bil2;
gotoxy(kol2+20,10);writeln(bil1,'+',bil2,'=',bil3);
readln;
end;
Procedure Kurang;
begin
masukkan;
bil3 := bil1 - bil2;
gotoxy(kol2+20,10);writeln(bil1,'-',bil2,'=',bil3);
readln;
end;
Procedure Kali;
begin
masukkan;
bil3 := bil1 * bil2;
gotoxy(kol2+20,10);writeln(bil1,'*',bil2,'=',bil3);
readln;
end;
Procedure bagi_bulat;
begin
masukkan;
bil3 := bil1 div bil2;
gotoxy(kol2+20,10);writeln(bil1,'div',bil2,'=',bil3);
readln;
end;
Procedure Sisa_bagi;
begin
masukkan;
bil3 := bil1 mod bil2;
gotoxy(kol2+20,10);writeln(bil1,'mod',bil2,'=',bil3);
readln;
end;
Procedure nama;
begin
clrscr;
gotoxy(17,5); writeln('Mhardiant');
readln;
end;
(* Program Utama *)
begin
repeat
clrscr;
gotoxy(kol,4); writeln('--------------------------');
gotoxy(kol,5); writeln('Operasi Bilangan Bulat');
gotoxy(kol,6); writeln('--------------------------');
gotoxy(kol,7); writeln('1. Penambahan');
gotoxy(kol,; writeln('2. Pengurangan');
gotoxy(kol,9); writeln('3. Perkalian');
gotoxy(kol,10);writeln('4. Pembagian Integer {Div} ');
gotoxy(kol,11); writeln('5. Sisa Hasil Bagi {Mod} ');
gotoxy(kol,12); writeln('6. nama');
gotoxy(kol,13); writeln('7. Selesai');
gotoxy(kol,14); writeln('--------------------------');
gotoxy(kol,15); writeln('Pilihan Anda [1..7] : [ ] ');
gotoxy(kol,16);writeln('--------------------------');
gotoxy (kol+23,15);readln(pilih);
case pilih of
1 : Tambah;
2 : Kurang;
3 : Kali;
4 : Bagi_bulat;
5 : Sisa_bagi;
6 : nama;
end;
until pilih = 7;
end.
program menu...
Contoh :
Program Calculator;
uses wincrt;
const
Kol = 10; kol2=35;
Var
x, y : longint;
Potonganharga : Longint;
Bil1,Bil2,Bil3,Pilih : Integer;
procedure masukkan;
begin
clrscr;
gotoxy(kol2,4);writeln('----------------------');
gotoxy(kol2,5);writeln(' Masukan Bilangan ');
gotoxy(kol2,6);writeln('----------------------');
gotoxy(kol2,7);writeln('Bilangan 1 : ');
gotoxy(kol2,;writeln('Bilangan 2 : ');
gotoxy(kol2,9);writeln('----------------------');
gotoxy(kol2,10);writeln('Hasil Operasi : ');
gotoxy(kol2,11);writeln('----------------------');
gotoxy(kol2+20,7);readln(bil1);
gotoxy(kol2+20,;readln(bil2);
end;
Procedure Tambah;
begin
masukkan;
bil3 := bil1 + bil2;
gotoxy(kol2+20,10);writeln(bil1,'+',bil2,'=',bil3);
readln;
end;
Procedure Kurang;
begin
masukkan;
bil3 := bil1 - bil2;
gotoxy(kol2+20,10);writeln(bil1,'-',bil2,'=',bil3);
readln;
end;
Procedure Kali;
begin
masukkan;
bil3 := bil1 * bil2;
gotoxy(kol2+20,10);writeln(bil1,'*',bil2,'=',bil3);
readln;
end;
Procedure bagi_bulat;
begin
masukkan;
bil3 := bil1 div bil2;
gotoxy(kol2+20,10);writeln(bil1,'div',bil2,'=',bil3);
readln;
end;
Procedure Sisa_bagi;
begin
masukkan;
bil3 := bil1 mod bil2;
gotoxy(kol2+20,10);writeln(bil1,'mod',bil2,'=',bil3);
readln;
end;
Procedure nama;
begin
clrscr;
gotoxy(17,5); writeln('Mhardiant');
readln;
end;
(* Program Utama *)
begin
repeat
clrscr;
gotoxy(kol,4); writeln('--------------------------');
gotoxy(kol,5); writeln('Operasi Bilangan Bulat');
gotoxy(kol,6); writeln('--------------------------');
gotoxy(kol,7); writeln('1. Penambahan');
gotoxy(kol,; writeln('2. Pengurangan');
gotoxy(kol,9); writeln('3. Perkalian');
gotoxy(kol,10);writeln('4. Pembagian Integer {Div} ');
gotoxy(kol,11); writeln('5. Sisa Hasil Bagi {Mod} ');
gotoxy(kol,12); writeln('6. nama');
gotoxy(kol,13); writeln('7. Selesai');
gotoxy(kol,14); writeln('--------------------------');
gotoxy(kol,15); writeln('Pilihan Anda [1..7] : [ ] ');
gotoxy(kol,16);writeln('--------------------------');
gotoxy (kol+23,15);readln(pilih);
case pilih of
1 : Tambah;
2 : Kurang;
3 : Kali;
4 : Bagi_bulat;
5 : Sisa_bagi;
6 : nama;
end;
until pilih = 7;
end.