Variables with the Artist

Alphabets Sounds Video

share us on:

In this lesson, Olga introduces the concept of variables in computer science, likening them to special boxes that store values, which can be used to create dynamic and adaptable programs. She illustrates the importance of variables through a relatable example of a birthday greeting that updates each year and a puzzle involving an artist that uses a variable to control the length of a line drawn. Ultimately, the lesson emphasizes that variables enhance the flexibility and power of programming, encouraging learners to incorporate them into their coding practices.

Understanding Variables with the Artist

Hello there! I’m Olga, and I have a cool story to share with you. I grew up in Russia and later moved to the United States to study at the University of Maryland, College Park. In 2009, I graduated with a degree in computer science. After that, I started working at Amazon as a software developer. I was super excited about this job because I love reading, especially books about history and interesting people like Steve Jobs and Tina Fey.

What is a Variable?

Let’s dive into something fun and important in computer science: variables! Imagine a variable as a special box where you can keep a value. When you use this variable in a computer program, it’s like opening the box to see what’s inside. This is super helpful because it lets you create smart programs that can change their behavior based on the value inside the variable.

For example, if you want to write a program that says “Happy Birthday, you’re turning 10” to your little brother, that’s great for this year. But what about next year? You’d want it to say “Happy Birthday, you’re turning 11.” To make this happen, you can create a variable called “age” to store your brother’s age. Then, you can write your program to say “Happy Birthday, you’re turning age.” Each year, you can update the “age” variable to be “age + 1” so it always has the right number.

Using Variables in a Puzzle

Now, let’s talk about a fun puzzle where we’ll use a variable to help an artist draw. In this puzzle, we’ll have a variable that sets the length of the line our artist will draw. There’s a special block called “move for board” that will check the length variable to see what value you’ve set it to. This way, you can control how long the line will be just by changing the variable’s value!

Why Variables are Important

Variables are super important in computer programming because they make your programs flexible and powerful. By using variables, you can create programs that adapt to different situations and solve problems in smart ways. So, next time you write a program, think about how you can use variables to make it even better!

That’s all for now! I hope you enjoyed learning about variables and how they can help you create amazing programs. Keep exploring and have fun with coding!

  1. How did Olga’s background and experiences influence her understanding and explanation of variables in computer science?
  2. What personal connections can you make between the concept of variables and your own experiences or interests?
  3. In what ways do you think the analogy of a variable as a “special box” helps in understanding its role in programming?
  4. Reflect on a time when you used or could have used a variable in a real-life situation. How did it help or how could it have helped?
  5. How does the example of the birthday program illustrate the practical use of variables in programming?
  6. What are some other scenarios or puzzles where you think variables could be effectively used to solve problems?
  7. Why do you think variables are considered a fundamental concept in computer programming, and how might they contribute to the flexibility of a program?
  8. After reading about Olga’s journey and her explanation of variables, what new insights or perspectives have you gained about learning and applying programming concepts?
  1. Variable Box Game

    Imagine a variable as a box that holds a secret number. Create your own “variable box” using a small container and a piece of paper. Write a number on the paper and place it inside the box. Ask a friend to guess the number by asking yes or no questions. This will help you understand how variables store information and can be used to reveal different values.

  2. Birthday Program Challenge

    Write a simple program using a coding platform like Scratch or Code.org. Create a variable called “age” and make your program say “Happy Birthday, you’re turning age!” Experiment by changing the value of the “age” variable to see how the output changes. This will show you how variables can make programs dynamic and adaptable.

  3. Line Length Puzzle

    Use a drawing app or a simple coding tool to create a puzzle where you control the length of a line using a variable. Set a variable for the line’s length and adjust it to see how the line changes. This activity will help you understand how variables can be used to control elements in a program.

  4. Variable Storytelling

    Write a short story where the main character’s age is a variable. As you read the story, change the age variable to see how it affects the story’s events. This will help you see how variables can change the outcome of a program or story.

  5. Variable Scavenger Hunt

    Create a scavenger hunt where each clue is a variable that leads to the next location. For example, the first clue could be “Find the object that is color” where “color” is a variable you can change. This will help you understand how variables can be used to store and change information in real-life scenarios.

Sure! Here’s a sanitized version of the transcript:

Hello, I’m Olga. I grew up in Russia and then went to the University of Maryland, College Park, where I earned a degree in computer science in 2009. After that, I joined Amazon as a software developer, a position I was really excited about because I love reading, especially historical fiction and non-fiction biographies of interesting people like Steve Jobs and Tina Fey.

A variable is a container that you can store a value in. When you use that variable in an algorithm, it opens up the container and looks at the value inside. This allows you to write smarter algorithms that behave differently depending on the value stored in the variable. For example, if you wanted to write an algorithm to say “Happy Birthday, you’re turning 10” to my little brother, that would be great now, but when I run it next year, I’d want it to say “Happy Birthday, you’re turning 11.” I could create a variable called “age” to store my brother’s age and write my algorithm to say “Happy Birthday, you’re turning age” instead. Because variables can change each year, I can update the variable “age” to equal “age + 1.”

In this puzzle, we’re going to be using a variable that will set the length of the line our artist draws later on in our code. The “move for board” block will look at that length variable to see what value you’ve set it to.

Let me know if you need any further modifications!

VariablesVariables are like containers in a computer program that hold information which can change. – In our game, we used variables to keep track of the player’s score.

ProgramA program is a set of instructions that a computer follows to perform a task. – We wrote a program to make the robot move forward and turn left.

ValueA value is the specific piece of information stored in a variable. – The value of the score variable increased by 10 points when I won the level.

AgeIn coding, age can refer to a variable that stores how old something is. – The program calculates the age of the tree by subtracting the planting year from the current year.

ArtistAn artist in coding can be a program or tool that creates visual designs or drawings. – We used a coding tool called “Turtle Artist” to draw shapes on the screen.

DrawTo draw in coding means to create shapes or pictures on the computer screen using code. – I learned how to draw a square by giving the computer specific instructions in the program.

LengthLength refers to the measurement of something from end to end, often used in coding to describe the size of an array or string. – The length of the password must be at least eight characters for it to be secure.

FlexibleFlexible in coding means that a program or code can easily adapt to different situations or changes. – Our code is flexible, so it can work with any number of players in the game.

PowerfulPowerful in coding describes a program or tool that can perform complex tasks efficiently. – The new software is powerful enough to process large amounts of data quickly.

CodingCoding is the process of writing instructions for a computer to follow. – We spent the afternoon coding a fun animation that made the characters dance on the screen.

All Video Lessons

Login your account

Please login your account to get started.

Don't have an account?

Register your account

Please sign up your account to get started.

Already have an account?