program Menu_Pilihan;
uses crt;
var
pilihan : char;
alas, tinggi, luas, A, B, nt, C, D, E, A1, A2, A3: integer;
J1, M1, D1, J2, M2, D2, TD1, TD2, J3, M3, D3, Sisa, Jlh: integer;
begin
textbackground(GREEN);clrscr;
window(17,7,63,19);textbackground(RED);clrscr;
gotoxy(19,2);write('Menu Pilihan');
gotoxy(19,3);write('============');
gotoxy(3,4);write('1. Menghitung Luas Segitiga');
gotoxy(3,5);write('2. Menentukan Nilai Tertinggi dari 2 Nilai');
gotoxy(3,6);write('3. Menyusun 3 Angka Secara Ascending');
gotoxy(3,7);write('4. Menghitung Lama Pembicaraan di Telepon');
gotoxy(3,8);write('0. Keluar');
gotoxy(3,10);write('Pilihan Anda {0-4} : ');readln(pilihan);
if(pilihan < '0') or (pilihan > '4')
then
begin
gotoxy(3,11);write('Salah Memilih Menu!');
readln;
end
else
begin
case (pilihan) of
'1' : begin
clrscr;
gotoxy(13,2);write('Menghitung Luas Segitiga');
gotoxy(13,3);write('========================');
gotoxy(3,4);write('Masukkan alas = ');readln(alas);
gotoxy(3,5);write('Masukkan tinggi = ');readln(tinggi);
Luas:= alas * tinggi div 2;
textcolor(9);gotoxy(3,6);write('Luas Segitiga = ',luas);
readln;
end;
'2' : begin
clrscr;
gotoxy(5,2);write('Menentukan Nilai Tertinggi dari 2 Nilai');
gotoxy(5,3);write('=======================================');
gotoxy(3,4);write('Masukkan nilai A = ');readln(A);
gotoxy(3,5);write('Masukkan nilai B = ');readln(B);
nt:=A;
if (B>A)
then
nt:=B;
gotoxy(3,6);textcolor(9);write('Nilai Tertinggi = ',nt);
readln;
end;
'3' : begin
clrscr;
gotoxy(7,2);write('Menyusun 3 Angka Secara Ascending');
gotoxy(7,3);write('=================================');
gotoxy(3,4);write('Masukkan nilai A = ');readln(C);
gotoxy(3,5);write('Masukkan nilai B = ');readln(D);
gotoxy(3,6);write('Masukkan nilai C = ');readln(E);
if (C<=D) and (D<=E)
then
begin
A1:=C;
A2:=D;
A3:=E;
end;
if (C<=E) and (E<=D)
then
begin
A1:=C;
A2:=E;
A3:=D;
end;
if (D<=E) and (E<=C)
then
begin
A1:=D;
A2:=E;
A3:=C;
end;
if (D<=C) and (C<=E)
then
begin
A1:=D;
A2:=C;
A3:=E;
end;
if (E<=C) and (C<=D)
then
begin
A1:=E;
A2:=C;
A3:=D;
end;
if (E<=D) and (D<=C)
then
begin
A1:=E;
A2:=D;
A3:=C;
end;
gotoxy(9,8);textcolor(10);write('Urutan Nilai Secara Ascending');
gotoxy(9,9);textcolor(10);write('=============================');
gotoxy(19,10);textcolor(10);write(A1,', ',A2,', ',A3);
readln;
end;
'4' : begin
clrscr;
gotoxy(7,2);write('Menghitung Lama Pembicaraan di Telepon');
gotoxy(7,3);write('======================================');
gotoxy(3,4);write('Masukkan Jam Mulai = ');readln(J1);
gotoxy(3,5);write('Masukkan Menit Mulai = ');readln(M1);
gotoxy(3,6);write('Masukkan Detik Mulai = ');readln(D1);
gotoxy(3,7);write('Masukkan Jam Akhir = ');readln(J2);
gotoxy(3,8);write('Masukkan Menit Akhir = ');readln(M2);
gotoxy(3,9);write('Masukkan Detik Akhir = ');readln(D2);
TD1:=(J1*3600)+(M1*60)+D1;
TD2:=(J2*3600)+(M2*60)+D2;
Jlh:=TD2-TD1;
J3:=Jlh div 3600;
Sisa:=Jlh mod 3600;
M3:=Sisa div 60;
D3:=Sisa mod 60;
gotoxy(3,10);write('Lama Pembicaraan = ');
gotoxy(3,11);write(J3,' jam : ',M3,' menit : ',D3,' detik');
readln;
end;
'0' : begin
clrscr;
gotoxy(10,7);
write('Keluar Program..Tekan Enter!');
readln;
end;
end;
end;
end.
uses crt;
var
pilihan : char;
alas, tinggi, luas, A, B, nt, C, D, E, A1, A2, A3: integer;
J1, M1, D1, J2, M2, D2, TD1, TD2, J3, M3, D3, Sisa, Jlh: integer;
begin
textbackground(GREEN);clrscr;
window(17,7,63,19);textbackground(RED);clrscr;
gotoxy(19,2);write('Menu Pilihan');
gotoxy(19,3);write('============');
gotoxy(3,4);write('1. Menghitung Luas Segitiga');
gotoxy(3,5);write('2. Menentukan Nilai Tertinggi dari 2 Nilai');
gotoxy(3,6);write('3. Menyusun 3 Angka Secara Ascending');
gotoxy(3,7);write('4. Menghitung Lama Pembicaraan di Telepon');
gotoxy(3,8);write('0. Keluar');
gotoxy(3,10);write('Pilihan Anda {0-4} : ');readln(pilihan);
if(pilihan < '0') or (pilihan > '4')
then
begin
gotoxy(3,11);write('Salah Memilih Menu!');
readln;
end
else
begin
case (pilihan) of
'1' : begin
clrscr;
gotoxy(13,2);write('Menghitung Luas Segitiga');
gotoxy(13,3);write('========================');
gotoxy(3,4);write('Masukkan alas = ');readln(alas);
gotoxy(3,5);write('Masukkan tinggi = ');readln(tinggi);
Luas:= alas * tinggi div 2;
textcolor(9);gotoxy(3,6);write('Luas Segitiga = ',luas);
readln;
end;
'2' : begin
clrscr;
gotoxy(5,2);write('Menentukan Nilai Tertinggi dari 2 Nilai');
gotoxy(5,3);write('=======================================');
gotoxy(3,4);write('Masukkan nilai A = ');readln(A);
gotoxy(3,5);write('Masukkan nilai B = ');readln(B);
nt:=A;
if (B>A)
then
nt:=B;
gotoxy(3,6);textcolor(9);write('Nilai Tertinggi = ',nt);
readln;
end;
'3' : begin
clrscr;
gotoxy(7,2);write('Menyusun 3 Angka Secara Ascending');
gotoxy(7,3);write('=================================');
gotoxy(3,4);write('Masukkan nilai A = ');readln(C);
gotoxy(3,5);write('Masukkan nilai B = ');readln(D);
gotoxy(3,6);write('Masukkan nilai C = ');readln(E);
if (C<=D) and (D<=E)
then
begin
A1:=C;
A2:=D;
A3:=E;
end;
if (C<=E) and (E<=D)
then
begin
A1:=C;
A2:=E;
A3:=D;
end;
if (D<=E) and (E<=C)
then
begin
A1:=D;
A2:=E;
A3:=C;
end;
if (D<=C) and (C<=E)
then
begin
A1:=D;
A2:=C;
A3:=E;
end;
if (E<=C) and (C<=D)
then
begin
A1:=E;
A2:=C;
A3:=D;
end;
if (E<=D) and (D<=C)
then
begin
A1:=E;
A2:=D;
A3:=C;
end;
gotoxy(9,8);textcolor(10);write('Urutan Nilai Secara Ascending');
gotoxy(9,9);textcolor(10);write('=============================');
gotoxy(19,10);textcolor(10);write(A1,', ',A2,', ',A3);
readln;
end;
'4' : begin
clrscr;
gotoxy(7,2);write('Menghitung Lama Pembicaraan di Telepon');
gotoxy(7,3);write('======================================');
gotoxy(3,4);write('Masukkan Jam Mulai = ');readln(J1);
gotoxy(3,5);write('Masukkan Menit Mulai = ');readln(M1);
gotoxy(3,6);write('Masukkan Detik Mulai = ');readln(D1);
gotoxy(3,7);write('Masukkan Jam Akhir = ');readln(J2);
gotoxy(3,8);write('Masukkan Menit Akhir = ');readln(M2);
gotoxy(3,9);write('Masukkan Detik Akhir = ');readln(D2);
TD1:=(J1*3600)+(M1*60)+D1;
TD2:=(J2*3600)+(M2*60)+D2;
Jlh:=TD2-TD1;
J3:=Jlh div 3600;
Sisa:=Jlh mod 3600;
M3:=Sisa div 60;
D3:=Sisa mod 60;
gotoxy(3,10);write('Lama Pembicaraan = ');
gotoxy(3,11);write(J3,' jam : ',M3,' menit : ',D3,' detik');
readln;
end;
'0' : begin
clrscr;
gotoxy(10,7);
write('Keluar Program..Tekan Enter!');
readln;
end;
end;
end;
end.
Post a Comment