Alice Community

Alice Community (
-   The Lounge (
-   -   Assignment 5 (

Mauricio 10-04-2016 12:03 PM

Assignment 5
Even though assignment five is about decision making, it actually helped to clarify more about variables, what they are and how to store them. I understand what a variable is but I was still somewhat confused about how it got its value after you set up the variable, although in this case the variable seem more like a constant because the exact number you had to enter in order for the bouncer to let you in was twenty-one, but I get it now, you create the variable and the value is assigned to that variable when the user enters a number. Making decisions with the If/Else statements will help to cut down on the amount of code that would be required otherwise. This will also be of helpful if you have to make changes to a program by making it easier to read through the code and be able to find any issues faster.

lucyrn99 10-05-2016 11:28 AM

Hi Mauricio,

I'm glad to hear that as we get more experience with different parts of the Alice program, it's making more sense to you. I feel the same way - the concept of parameters and variables are a little fuzzy, until you experiment with them in your own animations.

Regarding your question of how the variable got its value, I think of it this way:
when you create a new variable, you pick any value (for Assignment 5, it was a numerical value) as a placeholder.
The value you replace the placeholder with, is created by the 'what is your age' question that you ask the user.
Whatever answer your user gives when they are asked the question, that numerical answer then becomes the value in the variable.

Hope the above makes sense! Stick with it, we're all in this together and the concepts will start making sense the more practice we get. :)

All times are GMT -5. The time now is 06:53 PM.

Copyright ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.