Question
This program plays a simple game, where it as ks the player about their dog, and attempts to guess the dogs breed based on their
This program plays a simple game, where it as
ks the player about their dog,
and attempts to guess
the dogs breed based on their answers. For
simplicitys sake, there are only five possible dog breeds.
(
WARNING
: This part of the homework is the most challenging, so budget
plenty of time and brain p
ower. And read the instructions carefully!)
The program can ask the player about four characteristics. It should ask the
minimum
number of questions needed to guess the dogs breed.
(HINT: It should need to ask
no less
than two questions and
no more
tha
n
three questions to find the right breed.)
Do the dogs ears stick up
?
Does
the dog come in multiple colors
?
Can the dog bark
?
Does the dog have a curly tail?
For these inputs, the program can assume the following:
The user will only ever enter either lo
wercase
y
es
(for yes)
or lowercase
n
o
(for no)
Based on the users responses, the program must select the correct breed
and print it to the screen. Here are the possibilities for the dog breeds:
Dog has a curly tail and can bark:
Eurasier
Dog has a
curly tail and
cannot
bark:
Basenji
Dog does
not
have a curly tail and its ears stick up:
Pharaoh Hound
Dog does
not
have a curly tail, its ears do
not
stick up, and it does
come in multiple colors:
Chesapeake Bay Retriever
Dog does
not
have a curly tail,
its ears do
not
stick up, and it does
not
come in multiple colors:
Maremma Sheepdog
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