Activity 5: Echoing Wildcards

Echoing Wildcards

Let’s use the wildcard * and <star /> tag together to allow our bot to include user input in its response.

  1. If the user enters “My name is [name]”, the bot should respond with “Nice to meet you, [name]!”. Examples:

    InputOutput
    My name is JohnNice to meet you, John!
    My name is JaneNice to meet you, Jane!
    My name is BobNice to meet you, Bob!
  2. If the user enters “My favorite color is [color]”, the bot should respond with “I also like [color]!”. Examples:

    InputOutput
    My favorite color is blueI also like blue!
    My favorite color is redI also like red!
    My favorite color is greenI also like green!
  3. If the user enters “My favorite food is [food]”, the bot should respond with “[food]! Yum!”. Examples:

    InputOutput
    My favorite food is pizzapizza! Yum!
    My favorite food is pastapasta! Yum!
    My favorite food is sushisushi! Yum!