Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Did anyone act in both Click and The Aviator? Was there a movie released in 2010

ID: 3884861 • Letter: D

Question

Did anyone act in both Click and The Aviator? Was there a movie released in 2010 that did not star Jennifer Anniston? Who directed movies released in 2009? Using the: command, have Prolog list all such movies and their directors. Has anyone directed more than one movie? Does any movie have more than one director? Has anyone acted in more than one movie released in 2008? Who has worked with the same director in different years? Using the: command, have Prolog list all such actors, directors, the movies they worked on together, and the years the movies were released.

Explanation / Answer

Hi,

3)Did any one act in both in click and aviator?

Here we assue that the actor list in of click and aviator is available before and we will continue with using the existing member function.A list is a primitive datastructure in prologue.

/*CODE*/

Both([actor_list_click_start|Rest_of_actor_list_click],actor_list_aviator):-

if(member(actor_list_click_start,actor_list_aviator), true, Both(Rest_actor_list_click,actor_list_aviator)).

The function will return true if the actor of click exists in actors list of aviator.

4) Was there a movie in 2010 that did not star jennifer anniston?

For this question we can follow the same pattern of the above question.

searchja([first_list_movies_2010|rest_list_movies_2010]:-

if(+member(jennifer anniston,actors_first_list_movies_2010),true,searchja(rest_list_movies_2010)).

Here +member means adding not to the member function result.

5) who directed movies released in 2009?

All_directors_2009(list_given):-

if(year(2009,first_list_given),director(first_list_given),All_directors_2009(rest_list_given).

6)Has anyone directed more than one movie?

we can use same both funtion i have written for first question basically it is the duplicate member function.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote