Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C + + program to identify something by applying series of yes - no questions. To start, tell the user you are ready
Write a C program to identify something by applying series of yesno questions.
To start, tell the user you are ready to help them identify whatever it is that they are observing such as a car problem, and a song, an animal, a bird, a chemical compound, etc you choose. It's similar to the movie guessing game discussed in class example. Then in a series of at questions, identify or diagnose.
The program simply has to reach the end of its tree and present its diagnosis or answer to the user. It does not have to learn anything.
Innate Knowledge
"Innate" means that the program is "born" with certain knowledge. There's nothing for it to learn, because the programmer you already put knowledge in the form of questions and answers in its coding. You need to build the binary tree similar of the movie example.
Requirements
Allow user responses of Y y N and n do not require the user to type the full words "yes" or no
Include at least total nodes in your tree, with questions: a top node, its two descendants, and their descendants. The descendants of the last questions are to be answers.
Use dynamically allocate nodes to create nodes and add to the tree.
After the p pointer reaches an answer, present your diagnosis or identification and exit the ploop and let the program end.
At the end, write serialize down contents of the entire tree into a file call aitxt You have to use a recursive function to perform serialize down. You can either use the example function in class or write your own.
At the end, deallocate all the nodes.
You are not allowed to reuse movies as your problem domain.
Submissions:
Your CPP
The output file aitxt
The drawing of your binary tree you can use MS Word or PowerPoint to draw
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