You are on page 1of 4

Feasibility Studies:

Now a days, booking a hotel room has become very common when we go on a tour or work outside
of his station. So, this system should be easier and this system should suggest me the rooms and
hotels according to my constraints (comfort, budget etc.).
The system needs to be intelligent also. This system will find out the list of all hotels, all available
rooms of a hotel, all hotels in a specific place. It has some intelligence as it will show me all the
results which are possible for to take according to my constraints.
This system will also suggest me the rooms which are available in a region. This number of rooms
will be enough to accommodate visitor’s group size & budget. It will show all the possible options.
This system will make the hotel booking really easier & will help the customers and hotel owners
as well.
Predicates To be used in this System:

Prolog programs are made up of facts and rules. Facts and rules are also called clauses. They are
used to define predicates.

1. These Predicates will provide hotel list of a specific location.


hotel_name('hilton','bandarban').
hotel_name('hill_view','bandarban').
hotel_name('greenlounge','bandarban').

hotel_name('seaworld','coxsbazar').
hotel_name('coxtoday','coxsbazar').
hotel_name('oceanparadise','coxsbazar').

hotel_name('beachview','stmartin').
hotel_name('beachworld','stmartin').
hotel_name('seainn','stmartin').

2. These Predicated will provide all the necessary details of the hotel rooms (Type, Price ,Max
capacity, number available rooms of that type)

rooms('hilton','delux',1500,4,2).
rooms('hilton','semidelux',1200,4,2).
rooms('hilton','double',1500,2,4).
rooms('hill_view','delux',1400,4,2).
rooms('hill_view','semidelux',1100,4,2).
rooms('hill_view','double',800,2,4).
rooms('greenlounge','delux',1600,4,2).
rooms('greenlounge','semidelux',1300,4,2).
rooms('greenlounge','double',1100,2,4).
rooms('seaworld','delux',1500,4,2).
rooms('seaworld','semidelux',1300,4,2).
rooms('seaworld','double',1100,2,4).
rooms('coxtoday','delux',1400,4,2).
rooms('coxtoday','semidelux',1100,4,2).
rooms('coxtoday','double',800,2,4).
rooms('oceanparadise','delux',2000,4,2).
rooms('oceanparadise','semidelux',1600,4,2).
rooms('oceanparadise','double',1200,2,4).
rooms('beachview','delux',2200,4,2).
rooms('beachview','semidelux',1800,4,2).
rooms('beachview','double',1600,2,4).
rooms('beachworld','delux',1600,4,2).
rooms('beachworld','semidelux',1400,4,2).
rooms('beachworld','double',1200,2,4).
rooms('seainn','delux',2000,4,2).
rooms('seainn','semidelux',1700,4,2).
rooms('seainn','double',1300,2,4).
3. These predicates will contain the places.
places(bandarban)
places(coxsbazar).
places(stmartin).

Rules to be used in this system

1. This rule will be used to show all the hotels of a specific place
showhotel:-read(X),hotel_name(Y,X),write(Y),nl,fail.

2. This rule will take input of the name of a hotel & will show all the details in output.
detail_of_a_hotel:- write('enter hotel name : '),read(X),nl,rooms(X,RT,Pr,NP,TA)
,nl,write('Room Type: '),write(RT),write(' , Price: '),write(Pr),write(' , Maximum Capacity:
'),write(NP),write(', Number of rooms of that type : '),write(TA),nl ,fail.

3. Enter your destination & room type such as delux ,semidelux etc and will provide all the
rooms available of that type on that place.
specific_type_room_search:-write('enter your desired place : '),read(P), nl, write('enter room
type: '),read(Rt),nl, hotel_name(H,P),rooms(H,Rt,Pr,NP,TA),write('Hotel Name:
'),write(H),write(' , Price: '),write(Pr),write(' , Maximum Capacity: '),write(NP),write(',
Number of rooms of that type : '),write(TA),nl ,fail.

4. Find a room which will fit your budget.

find_rooms_below_price:- write('enter your desired place : '),read(P), nl, write('enter your


max budget: '),read(X),nl, hotel_name(H,P),rooms(H,Rt,Pr,NP,TA),X>=Pr,write('Hotel
Name: '),write(H),write('Room Type: '),write(Rt),write(' , Price: '),write(Pr),write(' ,
Maximum Capacity: '),write(NP),write(', Number of rooms of that type : '),write(TA),nl ,fail.

5. Find a room which have the capacity of your group & fit your budget
find_rooms_below_price_fulfilling_capcity:- write('enter your desired place : '),read(P),
nl,write('enter number of persons(less than or equal 4) : '),read(PP), nl, write('enter your
max budget: '),read(X),nl,
hotel_name(H,P),rooms(H,Rt,Pr,NP,TA),NP>=PP,X>=Pr,write('Hotel Name:
'),write(H),write('Room Type: '),write(Rt),write(' , Price: '),write(Pr),write(' , Maximum
Capacity: '),write(NP),write(', Number of rooms of that type : '),write(TA),nl ,fail.
6. These rules take place input, show all the hotels , then it will take hotel name input &
show details of that hotel.
showdetails:-read(P),showallhotels(P),read(H),showhoteldetails(H).
showallhotels(X):-repeat,hotel_name(A,X),write(A).
showhoteldetails(X):-repeat,rooms(X,A,B,C,D,E),write(A).
7. This rule will show all the places.
Showhotel:-read(X),hotel_name(Y,X),write(Y),nl,fail.

You might also like