Hallo Coding Maniak, Sudahkan Anda Ngoding Hari Ini ??
Hari Ini saya akan membagikan contoh program pascal reservasi hotel, algoritma pemilihan if sangat dominan disini jadi buat kalian yang kebetulan ada tugas membuat program pascal dengan algoritma pemilihan ini bisa dijadikan referensi, di dalam program ini ada daftar menu yang terdiri dari jenis-jenis ruangan hotel, harga serta fasilitas yang tersedia.
Ini adalah gambaran lengkapnya.
Dan ini adalah source codenya, seperti biasa saya lebih menuyarankan anda mengetik manual codingnya, supaya lebih terbiasa
program Hotel_Arief;
uses
crt;
label awal,akhir;
var
no:integer;
total,cash,harga,hsewa,kembalian:longint;
lm_nginap:integer;
jns_penginapan:string;
nama: string;
noroom: string;
kalimat, kata1, kata2 :string;
yesno: char;
begin
akhir: clrscr;
textcolor(110);
gotoxy(50,2);
writeln('Penginapan Mad Arief');
textcolor(white);
gotoxy(27,3); writeln(' ===================================================================='); textcolor(10);
gotoxy(2,4);
gotoxy(27,5);writeln(' Fasilitas Penginapan:');
textcolor(15);
gotoxy(27,6);writeln(' 1. Full AC');
gotoxy(27,7);writeln(' 2. Jaringan WIFI');
gotoxy(27,8);writeln(' 3. Pelayanan Penginapan 24 jam');
textcolor(14); writeln(' ');
gotoxy(27,10);writeln(' ___________________________________________________________________');
gotoxy(27,11);writeln(' | NO | Jenis Penginapan | Harga Sewa | Fasilitas Tambahan |');
gotoxy(27,12);writeln(' |____|___________________|____________|_____________________________|');
gotoxy(27,13);writeln(' | 1 | Executive Room | 1.000.000 | 1. TV LCD Satelite |');
gotoxy(27,14);writeln(' | | | | 2. King Size Bed |');
gotoxy(27,15);writeln(' | | | | 3. Shower Hot & Cool |');
gotoxy(27,16);writeln(' | | | | 4. Mini Bar |');
gotoxy(27,17);writeln(' |____|___________________|____________|_____________________________|');
gotoxy(27,18);writeln(' | 2 | Deluxe Room | 650.000 | 1. TV LCD 24 in |');
gotoxy(27,19);writeln(' | | | | 2. Queen Size Bed |');
gotoxy(27,20);writeln(' |____|___________________|____________|_____________________________|');
gotoxy(27,21);writeln(' | 3 | Standard Room | 300.000 | 1. TV 17 in |');
gotoxy(27,22);writeln(' | | | | 2. Single Bad |');
gotoxy(27,23);writeln(' |____|___________________|____________|_____________________________|');
writeln; readln;
begin
clrscr;
writeln;
textcolor(15);
write(' Nama Pengunjung = ');
readln (nama);
write(' Jenis Penginapan = ');
readln (no);
if no= 1 then harga:=1000000;
if no= 2 then harga:=650000;
if no= 3 then harga:=300000;
writeln(' Harga = ');
gotoxy(21,4);
writeln(harga);
write(' Nomor Kamar = ');
readln(noroom);
write(' Lama Menginap = ');
readln(lm_nginap);
writeln;
writeln(' STRUK PENGINAPAN ');
writeln(' ==================================================================');
writeln(' Nama Pengunjung = ');
gotoxy(21,10);
writeln(nama);
writeln(' Nomor Kamar = ');
gotoxy(21,11);
writeln(noroom);
writeln(' _________________________________________________________________');
writeln(' | NO | Jenis Penginapan | Harga Sewa | Lama Sewa | Total |');
writeln(' |____|__________________|____________|___________|________________|');
writeln(' | | | | | |');
writeln(' |____|__________________|____________|___________|________________|');
gotoxy(4,15);
writeln(no);
if no= 1 then jns_penginapan:=' Executive Room';
if no= 2 then jns_penginapan:=' Deluxe Room';
if no= 3 then jns_penginapan:=' Standrad Room';
gotoxy(8,15);
writeln(jns_penginapan);
if no= 1 then harga:=1000000;
if no= 2 then harga:=650000;
if no= 3 then harga:=300000;
gotoxy(28,15);writeln(harga);
gotoxy(44,15);writeln(lm_nginap);
total:= harga*lm_nginap;
gotoxy(56,15);
writeln(total);
writeln('');
writeln; write(' Cash = ') ;
readln (cash);
kembalian:= cash-total;
writeln(' Kembalian =');
gotoxy(14,19);
writeln(kembalian);
writeln; textcolor(15);
writeln;
writeln;
write(' Jika setuju klik ( Y ), jika tidak ( N ) = '); readln(yesno);
if yesno='Y' then goto awal;
if yesno= 'y' then goto awal;
if yesno='N' then goto akhir;
if yesno='n' then goto akhir;
readln;
end;
begin awal:
clrscr;
TEXTCOLOR(10);
kalimat := ' TERIMAKASIH ATAS KUNJUNGAN ANDA ';
REPEAT kata1 := COPY(kalimat,2,LENGTH(kalimat));
kata2 := COPY(kalimat,1,1);
kalimat:= CONCAT(kata1,kata2);
GOTOXY(40,10);
WRITE(kalimat);
DELAY(100);
UNTIL KEYPRESSED;
readln;
end;
end.
Dibawah ini adalah gambaran ketika program dijalankan.
Dan untuk inputannya bisa dilihat dibawah ini ada nama, jenis penginapan/ruangan yang diinginkan, harga, nomer kamar dan lama menginap. Setelah semua diisi dan menekan enter akan muncul seperti struk dibawah dan inputan cash/total biaya
Selamat Ngoding
"Dari newbie, untuk newbie dan oleh newbie"
Baca Juga
Program Permainan Sulap Angka
Program Menu Restoran
Baca Juga
Program Permainan Sulap Angka
Program Menu Restoran
0 comments:
Post a Comment