Question: Run the program and chat with Magpie. Complete the worksheet with the responses received as the following statements are entered: I want to build


Run the program and chat with Magpie. Complete the worksheet with the responses received as the following statements are entered: I want to build a robot. I want to understand French. Do you like me? You confuse me. Look at the code for the Magpie4 class. Trace it to see how it handles statements containing "I want to." Specifically look at the getResponse and transformIWantToStatement methods. Alter the code: Have it respond to "I want something" statements with "Would you really be happy if you had something?" In doing this, you need to be careful about where you place the check. Be sure you understand why. For example: Statement: I want fried chicken. Response: Would you really be happy if you had fried chicken? Now look at the Magpie4 class and locate the code that handles statements containing "you something me." Pay close attention to the getResponse method and when it calls the transform YouMeStatement method. Alter the code again: Have it respond to statements of the form 'I something you" with the restructuring "Why do you something me?" For example: Statement: I like you. Response: Why do you like me? Test the alterations by chatting with Magpie. Ensure the expected response appears. Record your conversation in the worksheet and answer the remaining questions for Activity 4.
Step by Step Solution
There are 3 Steps involved in it
Heres the modified code based on your instructions class Magpie def initself selfresponses I want to ... View full answer
Get step-by-step solutions from verified subject matter experts
