Variables Flashcards

1
Q

What is a variable?

A

Named reference to a value which are stored in computer’s memory(memory locations)`

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

What is a declaration?

A

Statement used to define what data type a variable is going to be.

*Note that unlike in python, basic programming languages need to be told what data type.
Example: Declaration -> Num myNumber
vs
Python Example: x = 5 (python knows this is a numeric value as strings are in quotations)

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

What is an indentifer?

A

What we define the name of the variable

Example: area = x + 5 | Area would be the identifier

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

What is a data type?

A

Used to describe the variable we are indentifying

Example: num = numeric data type | num mySalary would output a numeric value.

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

What is initializing the variable?

A

Telling the starting value for a variable.

Example: myName = Khazer | Khazer would be the initialized varible

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

Garbage

A

Variable that is not yet declared. Programs that use it will result in a logic error

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

What is Camel Casing?

A

When the variable name starts with a lowercase and uses an uppercase letter to show distinction(separation) between words without the use of a space.

Example: myName

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

What is Pascal Casing?

A

When the variable name uses uppercase letters to show distinction between words.

Example: MyName

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

Integer

A

Whole numbers that can be positive or negative.

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

What is a String?

A

Data type that contains words

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

What is a Numeric?

A

Data type that contains a number

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

Floating-point

A

Data type that contains a decimal point

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

Numeric Constant

A

Value that doesn’t change. Example would be the value 5. Will always be 5

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

String Constant

A

Text Value that once in “ “ is not changeable

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

What are the Three Rules Variable Names should follow?

A
  1. One word(no spaces), but you are able to use hyphens or underscores.
  2. Must start with a letter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly