Question: write the code in opl: As part of his training, Luke Skywalker must study ancient history, including the history of a blue planet in the

write the code in opl: As part of his training, Luke Skywalker must study ancient history, including the history of a blue planet in the milky way galaxy. People on that planet were very peculiar and Luke must solve a particular puzzling enigma. The problem is defined in terms of five people with different nationalities who lived in the first five houses of a street in the city of Atlanta. They practiced different professions, had each different favorite animals, and drank different beverages. Moreover, the houses were all painted in different colors. After some research in the archives, Luke gathered the following facts:
1. The English person lived in the red house.
2. The Spaniard owned the dog.
3. The Japanese was a painter.
4. The Italian drank tea.
5. The Norwegian lived in the first house on the left.
6. The owner of the green house drank coffee.
7. The green house was on the right of the white one.
8. The sculptor was breeding snails.
9. The diplomat lived in the yellow house.
10. Milk was drunk in the middle house.
11. The Norwegian lived next to the blue house.
12. The violinist drank fruit juice.
13. The fox was in the house next to that of the doctor.
14. The horse was in the house next to that of the diplomat.
Obi-Wan Kenobi wants to know who drank water and who owned the zebra on this strange blue planet. Can you help Luke find out? He can only use the following types of constraints (== and !=), as well as reification.
The output must include at least the following three arrays
int jobHouse[Jobs]
int animalHouse[Animals]
int drinkHouse[Drinks]
where
{string} Jobs ={ "painter", "diplomat", "violinist", "doctor", "sculptor" };
{string} Animals ={"dog", "zebra", "fox", "snail", "horse" };
{string} Drinks ={ "juice", "water", "tea", "coffee", "milk" };
Fill these arrays with the right values once your model is solved. The first array specifies the house of each job, the second the house of each animal, and the third one the house of each drink. Houses are numbered from 0 to 4, from left to right in the street.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!