Variables

by Osama M. Khaled last modified 2022-06-04T22:17:00+01:00

Programmers often think of variable names as names for memory locations, but there is much more to a variable than just a name.

Questions #: 7
Pass Score: 80.0%

    A program variable is an abstraction of a computer memory cell or collection of cells.

    True
    False

    A variable can be characterized as a sextuple of attributes

    (name, address, value, type, lifetime, and scope)

    True
    False

    A program variable is not associated with a machine address

    True
    False

    In many languages, it is possible for the same variable to be associated with different addresses at different times in the program

    True
    False

    A memory address in the program can be accessed by

    Only one variable
    More than one variable

    Two variables are aliases

    Variable named sum and totalwhere both are aliases.  If the following operations are made to total, what is the value of sum?

    sum = 1
    total = 2
    total = total + 3
    3
    1
    3
    5

    A value of a variable is stored in exactly a single physical memory cell

    True
    False