chapter 6 Flashcards

1
Q

what is the main thing computers do with data?

A

For all their complexity, the main business of computers is to move data from one place to another. Take a number — the balance in a person’s bank account. Move this number from the computer’s memory to the computer’s processing unit. Add a few dollars to the balance and then move it back to the computer’s memory. The movement of data

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

what is a variable and what happens when you change the variable in your code?

A

A variable is a placeholder. You can stick a number like 5.95 into a variable. After you’ve placed a number in the variable, you can change your mind and put a different number, like 30.95, into the variable. (That’s what varies in a variable.) Of course, when you put a new number in a variable, the old number is no longer there. If you didn’t save the old number somewhere else, the old number is gone.

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

what is stored in a variable & what kinds of variables can be stored in a variable?

A

The thing stored in a variable is called a value. A variable’s value can change during the run of a program. The value stored in a variable isn’t necessarily a number. (You can, for example, create a variable that always stores a letter.)

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

what is a variable type?

A

the kind of value stored in a variable is a variable type.

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

what is a variable name and how is it different from a variable?

A

There’s a subtle, almost unnoticeable difference between a variable and a variable’s name. Even in formal writing, I often use the word variable when I mean variable name. Strictly speaking, amount is the variable name, and all the memory storage associated with amount (including the value and type of amount) is the variable itself.

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

what else is a variable name besides the name of the variable itself?

A

a variable name is also an identifer– a name that you can make up in your own code.

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

what is an assignment statement ?

A

The statements with equal signs are called assignment statements. In an assignment statement, you assign a value to something. In many cases, this something is a variable.

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