54 635
Assignments Done
98,2%
Successfully Done
In November 2017
Your physics homework can be a real challenge, and the due date can be really close — feel free to use our assistance and get the desired result.
Be sure that math assignments completed by our experts will be error-free and done according to your instructions specified in the submitted order form.
Our experts will gladly share their knowledge and help you with programming homework. Keep up with the world’s newest programming trends.

23Questions:

11Free Answers by our Experts:

Ask Your question

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

member2(H, [_, H | _]):- !.
member2(H, [_, _ | T]) :- member2(H, T).

How many solutions - member2(X, [1, 2, 3, 4])?
num(Y, Y).
num(X, Y) :- X > 0, X1 is X - 2, num(X1, Y).

How many solutions - num(5, X)?
Doing a wait or not wait for restaurant seat
The Decision Tree
http://oi62.tinypic.com/rr850n.jpg

Code here.
http://pastebin.com/KVuUTBGk

Question:
I want to add a summary of the results output like
example(yes, [Pat=full, WaitEstimate=30-60, Alt=no, Reservation=no, Bar=yes]).

If I enter the results as below

?- patrons.
What is the size of the Patrons?
|: full.
What is the estimate waiting time?(write in minutes, ex:50)
|: 60.
Is there any alternative?
|: no.
Have you made any reservation?
|: no.
Do they offer a comfortable bar area for customer to wait in?
|: yes.
Your decision is to wait!
true.
write a prolog code that accepts input of CGPA from user and determine the level of that CGPA
There are 5 ships in a port:

1. The Greek ship leaves at six and carries coffee.
2. The Ship in the middle has a black chimney.
3. The English ship leaves at nine.
4. The French ship with blue chimney is to the left of a ship that carries coffee.
5. To the right of the ship carrying cocoa is a ship going to Marseille.
6. The Brazilian ship is heading for Manila.
7. Next to the ship carrying rice is a ship with a green chimney.
8. A ship going to Genoa leaves at five.
9. The Spanish ship leaves at seven and is to the right of the ship going to Marseille.
10. The ship with a red chimney goes to Hamburg.
11. Next to the ship leaving at seven is a ship with a white chimney.
12. The ship on the border carries corn.
13. The ship with a black chimney leaves at eight.
14. The ship carrying corn is anchored next to the ship carrying rice.
15. The ship to Hamburg leaves at six.

Which ship goes to Port Said? Which ship carries tea?
In this assignment, you are expected to implement a solution in Prolog to the N-Tiles Problem.N-Tiles
problem is problem of placing N copies of a tile T (TX/TY) on an SxS square grid so that no two copies
touch each other. Namely, N-Tiles problem takes three inputs:
• S: Grid Size
• N: Number of copies to place
• T : Tile definition in (TX,TY) form.
and produces an N-sized set of points on the grid satisfying the non-touching condition.

A call to ntiles predicate should fail if there exists no solution for the problem specified with parameters.
Below is given examples for a no-solution case and a case with 4 different solutions.
>ntiles(2/1,3,3,P).
No

>ntiles(2/1,3,2,P).
P=[1/1,1/3]?;
P=[1/1,2/3]?;
P=[2/1,1/3]?;
P=[2/1,2/3]?;
No.
Which one of the following prolog
programs correctly implement “if G
succeeds then execute goal P else
execute goal θ ?”
(A) if-else (G, P, θ) :- !, call(G), call(P).
if-else (G, P, θ) :- call(θ).
(B) if-else (G, P, θ) :- call(G), !, call(P).
if-else (G, P, θ) :- call(θ).
(C) if-else (G, P, θ) :- call(G), call(P), !.
if-else (G, P, θ) :- call(θ).
(D) All of the above
I have to create a heuristic algorithm where it searches through a list of places and determines the best way to navigate from a - b by the shortest distance sorting the list into order of place & distance and displaying that list without duplicates.

I have already wrote some Prolog code where it displays the place and distance but now I need to remove the duplicates. Can anyone help?
https://www.dropbox.com/s/wptinvfbg2nucoc/Assignment01.pdf
% Process guess takes a list of codes representing the answer, a list of codes representing the current
% "display phrase" with blanks in it, and the code of the letter that was just guessed. If the guess
% was right, call substitute to put the letter in the display phrase and check for a win. Otherwise, just
% get another guess from the user.

processGuess(AnsList,BlankList,GuessName, CountFailed):-
member(GuessName,AnsList),
!,
write('Correct!'),
nl,
substitute(AnsList, BlankList, GuessName, NewBlanks),
checkWin(AnsList,NewBlanks, CountFailed).

processGuess(AnsList, BlankList, _, CountFailed) :-
( CountFailed == 5
-> format('Sorry, game over. You didn\'t guess (~s)~n', [AnsList])
; write('Wrong Try Again!'),
nl,
CountFailed1 is CountFailed + 1,
getGuess(AnsList, BlankList, CountFailed1)
).
The main idea is to make a list where i will put all the wrong letters the user gave and check it everytime he gives another wrong letter