Question 1:
A. Write a predicate my_double/2 which consist of two arguments. The first argument of predicate is a list of integers(list 1) while the second argument is a list of integers(list 2) obtained through mathematical operation of the value of integer in list 1,Mathematical operation will only be executed if the value of integer is greater than 5,provide Prolog traces for following query:
B. Explain your code
Copyright By PowCoder代写 加微信 powcoder
Question 2:
a. Use the structure in Prolog to represent reservation of wedding catering packages shown in Table 1
Package code:
Price per pax
Date of the wedding day
3 stars hotel
Merak Kayangan Hall
Any specified venue
b. Write separate predicates for following queries:
I. list all package(s) that have been booked based on the date entered. Use automatic backtracking method to list out the package(s)
Ii. Calculate the total amount of price of the selected package based on the number of pax entered.
Iii. write one(1) utility to be used together with the predicate defined in question b(i)
c. Explain how you solved the problem
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com