Make a program which plays a simple game of 20 2 Questions. The first question should be "animal, vegetable, or mineral?" Then, the second question should be "is it bigger than a breadbox?" Then, display one of six possible responses, depending on their answers. You can choose what answers to give for each of the six possibilities.
Here's a suggestion:
size \ type
animal
vegetable
mineral
smaller than a breadbox
squirrel
carrot
paper clip
bigger than a breadbox
moose
watermelon
Camaro
You must use nested if
statements to do this.
TWO QUESTIONS!
Think of an object, and I'll try to guess it.
Question 1) Is it animal, vegetable, or mineral?
> animal
Question 2) Is it bigger than a breadbox?
> no
My guess is that you are thinking of a mouse.
I would ask you if I'm right, but I don't actually care.
©2017 Graham Mitchell