about | help | code help+videos | done | prefs |
apcsaChatbotsRearrangeStartsIAm
Given an input String, first decide if the String starts with "I am ", like "I am hungry". If it does not start with "I am ", return "I don't understand". If it does start with "I am ", return a response that includes part of the input in the form "Why are you (rest of input)?" If you are still confused, see the input/output test cases. HINT: use substring to capture the rest of the input, which becomes part of the output.apcsaChatbotsRearrangeStartsIAm("I am hungry") → "Why are you hungry?" apcsaChatbotsRearrangeStartsIAm("I was hungry") → "I don't understand" apcsaChatbotsRearrangeStartsIAm("") → "I don't understand" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 210
Copyright Nick Parlante 2017 - privacy