8 Programming Flashcards
Where can data be stored in a program?
variables and constants
What is a variable?
A named memory location that can store data. The data can change whilst a program is running
What is a constant?
A named memory location that can store data. The data cannot change whilst a program is running
What is an identifier?
A name given to a variable, constant, data structure (eg: array) or subroutine
What is assignment?
A type of programming statement that stores data in a variable or constant
What is a data type?
The characteristics of a piece of data
What are common data types?
String, integer, real / single / double (same), boolean, char
What is casting?
Converting data from one data type to another data type
What is output?
Data that is displayed to the user, usually on-screen
What is concatenation?
Joining two or more strings together
What is input?
The user entering data into the program, usually from a keyboard
What is an arithmetic operator?
A symbol that performs a mathematical function (eg: +, -)
What are the most common arithmetic operators?
+, -, *, /, DIV, MOD, ^
What does the arithmetic operator DIV do?
DIV gives the whole number after the first number is divided by the second, it ignores any decimals
What does the arithmetic operator MOD do?
MOD gives the remainder after the first number is divided by the second
What are parenthesis?
Brackets in a mathematical statement. They determine which calculations are performed first
What is a sequence?
A programming construct. Instructions are run once and in the order they are written
What is selection?
A programming construct. A condition is checked and this determines which code is run, or not run
What is an IF statement?
A type of selection construct where the result of the condition is either true or false
What is a CASE statement?
A type of selection construct where there is a list of different values to compare a single value against
What does a condition need and why?
Conditions need logical operators as these allow for comparisons to be made
What is a logical operator?
A symbol that performs a comparison resulting in True or False.
What are examples of logical operators?
equals( = or ==), not equal to (<> or !=), less than (<), less than or equal to (<=), greater than (>), greater than or equal to (>=)
What is iteration (or a loop)?
A programming construct. Code is run multiple times - either a finite number of times (count-controlled), until a condition is true (post-condition) or while a condition is true (pre-condition)