User Input in Alice3

The goal of this lesson is to learn how to get input from the user and store those values in variables.
You will be able to ask the user for information such as his name and age, and then use that information later in the program.

In this module, you will learn create an interactive program.
Your program will ask the user his name and then make a 3D character say "hello" using the name they entered.
In order to do this you will:

  • Select and use functions to ask the user a question and store the result.
  • Use functions to get information from the user.
  • Use stored values in the code.
  • Use input from users in the code.

Print the lesson

Please study the material at each of the links below.

  1. Ask the users name and say hello: Use the function getStringFromUser to ask the user his name,
    then say hello using the name entered.
  2. Ask the user how old they are: Use the function getIntegerFromUser to ask the user's age.
  3. Ask the users their favorite food: Wolf asks "What's your favorite food, then says that is his favorite too.
  4. Panda asks how much to turn: We ask the user for a double and the panda spins around that amount.
  5. Discussion Questions

Active Learning

Ask the user some questions

Like us on Facebook:


OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher: Zebra0.com
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License
Last modified: May 17 2017 16:49:49.