Activity 6

Workshop Resources

Let’s see if we can write a program that first prints the following two lines to console:

Welcome!
How can I help you today?

Afterwards, the console waits for user input. After the user types something in the console and presses Enter, the computer prints out:

You asked: [input]?
I don’t know the answer to [input]. Goodbye!

“[input]” should be replaced with whatever the user had typed into the console.

For example, if you wanted to ask “How old am I?”, the computer will print out that it doesn’t know the answer to that.

This is very similar to the example that we went through together above. Try making some small changes from what we have already given you.