Lecture 4 Flashcards
What are variables in programming?
Variables are abstractions in a language for the memory cells of a machine.
What are the main attributes of a variable?
Type, Scope, Lifetime.
What are names associated with in programming?
Names are associated with subprograms, formal parameters, and other program constructs.
What is an Identifier?
Identifier is another term for a name.
What are some design issues for names?
Whether names are case sensitive and whether special words are reserved words or keywords.
What are the forms of names(name forms) in programming languages?
Names are strings of characters used to identify entities in a program, with different length limitations and naming conventions depending on the language.
What are common naming conventions?
Underscore characters and Camel notation.
What is the controversy around case sensitivity in programming languages?
Some believe it detracts from readability, while others do not see it as a problem.
What are special words in programming languages used for?
To make programs more readable and to separate syntactic parts of statements and programs.
What is the difference between a keyword and a reserved word?
A keyword is special only in certain contexts, while a reserved word cannot be used as a name.
What attributes characterize a variable?
Name, address, type, lifetime, and scope.
What is the address of a variable?
The machine memory address associated with the variable.
What are aliases?
When more than one variable name can access the same memory location.
What does the type of a variable determine?
The type determines the set of values the variable can store and the operations that can be performed on those values.
What is the value of a variable?
The contents of the memory cell(s) associated with the variable.