Fundamentals of Programming Flashcards
What two things are data types defined by?
- The values they take
- The operations that can be performed on them
Is -44 an Integer?
Yes.
Integer : Whole number, positive or negative, including 0
Which data type can only be true or false?
Boolean
What is a user-defined data type?
A data type derived from existing data types in order to create a customised data structure
What is assignment?
Giving a constant/variable a value
What is iteration?
Repeating an instruction
What is a subroutine?
A named block of code with a set of instructions, designed to perform a frequently used operation
Which iteration is the number of repetitions not needed before the loop starts?
Condition controlled/Indefinite
What visible feature of program code signifies nesting?
Indentation
14 DIV 3?
4
30 MOD 4
2 (MOD is the remainder)
1 XOR 1?
0
Advantages of constants over hard-coded values
- Constants can have identifiers - easier for a human to understand
- When updating a value, constants only get updated at 1 position
What is concatenation?
Join two or more strings together to form a new, longer string
What is a seed value used for?
Generating random numbers
(The seed value initialises it)