Question
Assignment 5 In this assignment you are required to implement a guessing game using a binary tree! For more details about the game read the
Assignment 5 In this assignment you are required to implement a guessing game using a binary tree! For more details about the game read the following introduction to decision trees & description for the game. (From the book Data structures and Abstraction with Java, 5th edition, pages 873-875). _________________________________________________________________ The interaction between the user and the program should be as the following; Look at the scenarios: Scenario 1: Think of a country and I will guess it. Is it in North America? > yes My guess is U.S.A. Am I right? > yes I win. Play again? yes
Scenario 2: Think of a country and I will guess it. Is it in North America? > no My guess is Brazil. Am I right? > yes I win. Play again? yes
Scenario 3: Think of a country and I will guess it. Is it in North America? > no My guess is Brazil. Am I right? > no I give up; what are you thinking of? > England Give me a question whose answer is yes for England but no for Brazil > Is it in Europe? Play again? yes
Scenario 4: Think of a country and I will guess it. Is it in North America? > no Is it in Europe? > yes My guess is England. Am I right? > yes I win. Play again? yes
Scenario 5: Think of a country and I will guess it. Is it in North America? > no Is it in Europe? > no My guess is Brazil. Am I right? > yes I win. Play again? Yes
Scenario 6: Think of a country and I will guess it. Is it in North America? > no Is it in Europe? > no My guess is Brazil. Am I right? > yes I win. Play again? Yes
Scenario 7: Think of a country and I will guess it. Is it in North America? > no Is it in Europe? > no My guess is Brazil. Am I right? > no I give up; what are you thinking of? > Palestine Give me a question whose answer is yes for Palestine but no for Brazil > Is it Arabic Country Play again? yes
Scenario 8: Think of a country and I will guess it. Is it in North America? > no Is it in Europe? > no Is it Arabic Country? > no My guess is Brazil. Am I right? > yes I win. Play again? no
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