Unit 2 Programming (C7) Flashcards
What is a variable?
A location in memory that can store one or more values in RAM. They are assigned an identifier upon creation.
What is an identifier?
A name given to a variable which allows the programmer to distinguish it from other variables.
What are the four data types?
String, Integer, Float, Real, Boolean
What is a string?
Data which contains a sequence of characters that can be letters, numbers or special characters.
What is an integer?
Data which contains only whole numbers
What is a real?
Data which contains decimal numbers
What is a Boolean?
Data which contains a “True” or “False” statement
What is an input?
Data entered by the user into the program
What is casting?
Changing the data type of a variable, such as an integer, 54, to a string “54”. This can be done by using the name of the data type and putting the data or variable in brackets i.e. str(54)
What is a modulus (a MOD number)?
The remainder that is left when a number is divided by another. Represented by the % sign i.e. 5 % 2 = 1
What is a quotient (a DIV number)?
Returns the nearest whole number of a division (known as the quotient) i.e. 5 // 2 = 2
What is an exponential?
Multiplying a number to the power of another (squaring cubing etc.)
What is a concatenation?
The linking of two strings using a +
What is string traversal?
Programming software is able to keep track of the position of every character within the string, allowing you to change individual characters without affecting the whole string.
What do you use to change the case of a variable?
variable.upper() or variable.lower()