Answered step by step
Verified Expert Solution
Question
1 Approved Answer
There are five houses in a row, each painted a different color. In each house lives a person with a different nationality. The five owners
There are five houses in a row, each painted a different color. In each house lives a person with a different nationality. The five owners each drink a different drink, smoke a different brand of tobacco, and keep a different pet. One of the pets is a walleye pike.
The Brit lives in the red house
The Swede keeps dogs as pets
The Dane drinks tea
The green house is on the left of and next to the white house
The green house owner drinks coffee
The person who smokes Pall Malls keeps birds
The owner of the yellow house smokes Dunhills
The man living in the house right in the center drinks milk
The man who smokes Blends lives next to the one who keeps cats
The Norwegian lives in the first house
The man who keeps horses lives next to the one who smokes Dunhills
The owner who smokes Bluemasters drinks beer
The German smokes Princes
The Norwegian lives next to the blue house
The man who smokes Blends has a neighbor who drinks water
Who owns the fish?
The assignment is to use backtracking to solve the riddle. I have solved it by hand on my own and deduced that the green house owns the fish. I want to code this in Java, but I need some help in the logic and how to code it
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started