Programming-Chapter 3(1) Flashcards
Processing data
Variable
refers to a memory location used to store values
String
Is used for combinations of characters, such as names, phone numbers and ID numbers
Numeric literals
numbers that are written into the programs code
Variable rules
Declare a variable before using it
You can only assign a value to a variable if the value is compatible with the variables’ data type
Always ensure that a variable is either initialized or gets a value at some point
Local variables
Variables that are declared inside a method(event handler) are called local variables
They only belong to that method
Only statements inside the method can access the variable
Scope
refers to the part of a program in which a variable can be accessed
A variables lifetime
Is the time period during which the variable exists in memory while the program is running
Concatenation
Joins two strings together, can also happen with another data type