Recall & Review
beginner
What is a variable in programming?
A variable is a named storage that holds data which can change while the program runs. Think of it like a labeled box where you keep things you might need later.
Click to reveal answer
beginner
Why do we need variables in a program?
Variables let us store information so we can use or change it later. Without variables, we would have to repeat the same data everywhere, which is hard to manage.Click to reveal answer
beginner
How do variables help in real-life programming?
Variables help keep track of things like user input, scores in a game, or results of calculations. They make programs flexible and interactive.
Click to reveal answer
intermediate
What happens if you don’t use variables and hard-code values instead?
The program becomes rigid and hard to change. If you want to update a value, you must find and change it everywhere, which can cause mistakes.
Click to reveal answer
beginner
In Go, how do you declare a variable?
You use the keyword var followed by the name and type, like var age int. This creates a box named age that can hold an integer.
Click to reveal answer
Why are variables important in programming?
✗ Incorrect
Variables store data so you can use or change it later, making programs flexible.
What is a variable like in real life?
✗ Incorrect
Variables are like labeled boxes where you store data you might need later.
In Go, which keyword is used to declare a variable?
✗ Incorrect
Go uses the keyword var to declare variables.
What is a downside of not using variables and hard-coding values?
✗ Incorrect
Hard-coded values make programs hard to maintain and update.
Which of these is NOT a reason to use variables?
✗ Incorrect
Variables help avoid repeating the same value everywhere.
Explain why variables are needed in programming using a real-life example.
Think about how you keep things organized at home or school.
You got /4 concepts.
Describe what would happen if a program did not use variables and only used fixed values.
Imagine writing your phone number everywhere instead of once.
You got /4 concepts.