Training - Dr. Bobby
Dr. Bobby is a computer psychiatrist. You will program Dr. Bobby by writing a program that meets the following requirements:
The user can ask a question to the system by typing it in a textbox and clicking on a button. After clicking the button, the answer will appear.
- If the question starts with the word why then Dr. Bobby responds with “Why do you think?”.
- If the question starts with the word who then Dr. Bobby responds with “Who do you think, " where is equal to the text filled in by the user minus _who_. Example: The user types "Who is Santa Claus?" Dr. Bobby: Who do you think, is Santa Claus?"
- If the question starts with the word what then Dr. Bobby responds with “What do you think, " where is equal to the text filled in by the user minus _what_. Example: The user types "What is the purpose of this conversation?" Dr. Bobby: What do you think, is the purpose of this conversation?"
- In other cases, Dr. Boddy responds “Why do you want to know, do you think?”