Constants and Variables Flashcards

1
Q

What can be stored as constants or variables?

A

Data types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the name of a constant or variable linked to?

A

Memory location that stores the data value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the size of the memory location rely on?

A

The data type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does a constant work?

A

It’s assigned to a data value at design time that can’t be changed. The constant remains the same.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens if you try change the value of a constant?

A

The interpreter or compiler will return an error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What makes variables more useful than constants?

A

They can have their data values changed but NOT their data type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What often needs to happen to be able to use variables or constants in a program?

A

They need to be declared at the start.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you make the code to easier follow for constants and variables?

A

Follow standard naming conventions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly