Can anyone help me come up with the classes and methods needed for this program. I can write them myself. I just need some ideas for the design and some
test plans. All of which I can write on my own. I am just asking for some suggestions on how you all at the ranch would tackle this problem as experienced programmers.
I need to write a program that can learn about players in a particular sport. The program will play a game in which the user thinks of a player, and the program tries to guess the player. When it fails to guess the player, the program solicits information from the user that will help it do better next time. For example, here is a sample transcript of the program in action (computer output in black, user input in red italics):
Pick a sport:
basketball
I don't know anything about basketball. Please teach me.
Who is your favorite player?
Magic Johnson
Ok, think of a player and I will try to guess who it is. Ready?
Yes
Is it Magic Johnson?
No
I give up. Who is it?
Michael Jordan
Please enter a question whose answer is yes for Michael Jordan
and no for Magic Johnson:
Is he known for sticking his tongue out?
Ok, think of a player and I will try to guess who it is. Ready?
Yes
Is he known for sticking his tongue out?
No
Is it Magic Johnson?
No
I give up. Who is it?
Mugsy Bogues
Please enter a question whose answer is yes for Mugsy Bogues
and no for Magic Johnson:
Is he shorter than 6 feet?
Ok, think of a player and I will try to guess who it is. Ready?
Yes
Is he known for sticking his tongue out?
No
Is he shorter than 6 feet?
Yes
Is it Mugsy Bogues?
Yes
I win!
Ok, think of a player and I will try to guess who it is. Ready?
No
Good-bye. Pick basketball next time to continue game.
Between sessions, the program will save the information it knows in a file named game.txt, where game is the name entered by the user. (In this case, the file would be basketball.txt.) If the user picks the same game later, the program will re-load what it already knows about that game. For example, the next session might proceed
Pick a sport:
basketball
Ok, think of a player and I will try to guess who it is. Ready?
Yes
Is he known for sticking his tongue out?
Uh-huh
I'm sorry. I didn't understand that answer. Let's try again.
Is he known for sticking his tongue out?
Yes
Is it Michael Jordan?
Yes
I win!
Ok, think of a player and I will try to guess who it is. Ready?
Yes
Is he known for sticking his tongue out?
No
Is he shorter than 6 feet?
Yes
Is it Mugsy Bogues?
No
I give up. Who is it?
Spud Webb
Please enter a question whose answer is yes for Spud Webb
and no for Mugsy Bogues:
Did he win the Slam Dunk contest?
Ok, think of a player and I will try to guess who it is. Ready?
No
Good-bye. Pick basketball next time to continue game.
Thanks for your help!