Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Thread Tools Display Modes
Assignment 5
Status: Offline
Posts: 14
Join Date: Aug 2016
Default Assignment 5 - 10-04-2016, 12:03 PM

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.
Reply With Quote
Status: Offline
Posts: 23
Join Date: Aug 2016
Location: Dallas TX
Default 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.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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