Business Definition for: variable
variable
a symbol in a programming language that represents a data item, such as a numerical value or a character string, that can change its value during the execution of a program. Programming languages typically require that variable names start with letters.
See also
singleton variable
,
data types
,
anonymous variable
,
data structures
variable
In general:value that changes.
Market research:value that changes as a result of direct intervention (
independent variable
) or a change in another variable (
dependent variable
) A variable may be numerical or classificatory, such as gender. In market research, key variables must be identified. For example, an airline might wish to measure its competitive position according to the attitudes of air travelers. The key independent variables that might influence their attitudes (attitude being the dependent variable) would include reservation service, baggage handling, check-in procedures, seat comfort, and so forth. These would have varying values, depending upon consumer opinion of them. In a direct-mail package or advertisement, both the characteristics of the promotion and consumer response to it are variables. To test a promotion, one or more variables such as
offer
or
copy
are changed, to measure resultant changes in response. In this example, offer and copy are independent variables, and response is the dependent variable. It is best, when testing, to change only one independent variable per test, so that differences in the dependent variable can clearly be attributed to that change. If more than one independent variable is changed, it will not be clear whether the difference in response is caused by one or more of the changes or, also, whether the change caused by each variable is in the same direction. One change may increase response; the other may decrease it.
variable
data item that can change its value; also called a factor or an element.
Related Terms:
in Prolog, a variable that occurs only once in a fact or rule. Since all variables are local, a singleton variable does not carry information from one place to another, and it should be replaced by an anonymous variable.
kinds of information that can be represented in a computer program, such as whole numbers, floating-point numbers, Boolean values (true and false), characters, strings, and pointers. In most programming languages, the type of each variable must be declared before the variable can be used. Some languages such as LISP, Prolog, andVisual Basic allow some or all variables to take on values of any type.
In many programming languages, programmers can define their own types, either as subranges of existing types (e.g., numbers between 0 and 23), or as data structures combining smaller units of information. In object-oriented programming, user-defined types can have procedures (called methods) associated with them.
in Prolog, a variable (written _) that does not retain a value. If several anonymous variables occur in the same fact or rule, they are not the same variable. In pattern matching, anonymous variables match anything.
ways of arranging information in the memory of a computer. In computer programming, it is often necessary to store large numbers of items in such a manner as to reflect a relationship between them. The three basic ways of doing this are the following:
- An array consists of many items of the same type, identified by number. The examination scores of a college class might be represented as an array of numbers.A picture can be represented as a large array of brightness readings, one for each of the thousands of cells into which the picture is divided.
- A record (in C, a struct) consists of items of different types, stored together. For example, the teacher's record of an individual student might consist of a name (character data), number of absences (an integer), and a grade average (a floating-point number). Records and arrays can be combined. The teacher's records of the entire class form an array of individual records; each record might contain, among other things, an array of test scores.
- A linked list is like an array except that the physical memory locations in which the items are stored are not necessarily consecutive; instead, the location of the next item is stored alongside each item. This makes it possible to insert items in the middle of the list without moving other items to make room. More complex linked structures, such as trees, can be constructed by storing more than one address with each item.
- An object. See object; object-oriented programming.
Referring Terms:
Copyright © 2006, 2003, 2000, 1998, 1996, 1995, 1992, 1989, 1986 by Barron's Educational Series, Inc. Reprinted by arrangement with Publisher.
Copyright c 2000, 1994, 1987 by Barron's Educational Series, Inc. Reprinted by arrangement with Publisher.
Copyright © 2007, 2000, 1997, 1987, by Barron's Educational Series, Inc. Reprinted by arrangement with Publisher.