Recall & Review
beginner
What is a variable in programming?
A variable is a name that stores a value in the computer's memory. It helps us keep and use data while the program runs.
Click to reveal answer
beginner
Why do we need variables instead of just using numbers directly?
Variables let us store values that can change or be reused. This makes programs flexible and easier to read and update.Click to reveal answer
beginner
How do variables help when you want to do math with changing numbers?
Variables hold the numbers so you can update them or use them in calculations without rewriting the whole program.
Click to reveal answer
beginner
What happens if you don’t use variables and want to change a value in your program?
You would have to change every place the value appears, which is slow and error-prone. Variables let you change the value once.Click to reveal answer
beginner
Can variables store different types of data? Give an example.
Yes, variables can store numbers, text, or other data types. For example, an int variable stores whole numbers, and a string variable stores words.
Click to reveal answer
What is the main reason to use variables in a program?
✗ Incorrect
Variables store values that can change or be reused, making programs flexible.
If you want to add two numbers that might change, what should you use?
✗ Incorrect
Variables hold numbers so you can change them without rewriting the code.
What happens if you don’t use variables and want to update a value used many times?
✗ Incorrect
Without variables, you must change every place the value appears, which is inefficient.
Which of these can a variable store?
✗ Incorrect
Variables can store different data types like numbers and text.
Why is using variables better than using fixed numbers everywhere?
✗ Incorrect
Variables make programs easier to update and understand by storing values in one place.
Explain in your own words why variables are important in programming.
Think about how you would keep track of changing information in a program.
You got /4 concepts.
Describe a real-life example where using a variable in a program would be helpful.
Imagine you are keeping score in a game or tracking temperature.
You got /4 concepts.