Programming Flashcards
What data types are there?
Integer
Real
Character
String
Boolean
What does this data type mean?
Boolean
True or False
What does this data type mean?
Real
Decimal numbers
What does this data type mean?
Integer
Whole numbers
What does this data type mean?
Character
A single alphanumeric character
What does this data type mean?
String
One or more alphanumeric characters
What are the limitations of different data types?
integers and real numbers cannot be concatenated, ie joined together.
numbers held in strings cannot be subject to mathematical operations.
What is casting?
When a programmer needs to change the data type of the contents of a variable.
What is a computer program?
Sequences of instructions for a computer.
What is a sequence?
a set of instructions that follow on one from another
What is an instruction?
A single action that can be performed by a computer processor
What is a selection?
A decision within a computer program when the program decides to move on based on the results of an event.
What is an iteration?
The repetition of a block of statements within a computer program.
What is execution?
The process of a program being run on a computer.
What are the two types of iteration?
Definite iteration (also known as count-controlled iteration)
Indefinite iteration
(also known as condition-controlled iteration)
What is a variable?
A variable is a named piece of memory that holds a value
What is an identifier?
A variable’s name is known as an identifier.
What is the naming convention?
It can contain letters and numbers but must start with a letter.
It must contain at least one letter - at the start of the name.
It must not contain special characters or punctuation characters. An underscore can be used. Spaces are not allowed.
The name should be meaningful.
What does assignment mean?
Giving a variable a value is known as assignment
What is declaration?
Most programming languages require a variable to be identified before a value is assigned to it. It is explicitly declared.
What is a constant?
A constant is a named piece of memory where the value cannot be changed while a program runs
What is a global variable?
A global variable is one that can be accessed and changed throughout the whole program
What is a local variable?
Local variables only exist within a particular subroutine.
Why are local variables better than global variables?
Using local variables rather than global variables makes it easier to debug a program as the value of that variable can only be read or changed within one subroutine.
Another advantage of local variables is memory efficiency. Once a subroutine has finished running, the memory used for all local variables is removed