Computer Science 1026A/B Chapter Notes - Chapter 2: Primitive Data Type, Elementary Arithmetic, String Literal
terubarenuka and 39895 others unlocked
26
COMPSCI 1026A/B Full Course Notes
Verified Note
26 documents
Document Summary
Variable: a variable is a storage location in a computer program. Each variable has a name and holds a value. Assignment statement: an assignment statement stores a value in a variable. A variable is created the first time it is assigned a value. Assigning a value to an existing variable replaces the previously store value. The assignment operator = does not denote mathematical equality. Data type: the data type of a value specifies how the value is stored in the compute and what operation can be performed on the value. The data type provide by the language itself is called a primitive data type. (float, string, int, etc) Literal == it basically means the value in the given variable/data type. Once you have initialized a variable with a value of a particular type, you should take care that you keep storing values of the same type in that variable. For example, because tax rates are not necessarily.