T7 - Programming fundamentals Flashcards
1
Q
data type
A
The kind of values that can be used in a data item
2
Q
eg of data types
A
integer, float / real, character, string, Boolean
3
Q
eg of arithmetic operators
A
+, -, *, /, ^, MOD, DIV
4
Q
The operator DIV
A
is used for integer division, also known as quotient
5
Q
MOD (modulus) is
A
used to find the remainder when dividing one integer by another
6
Q
data type and memory
A
Data types will determine the amount of memory allocated
7
Q
constants in pseudocode n python
A
const
-snakecase inpython
8
Q
Snake case
A
- separated with an underscore and capital letters
9
Q
Use of snake case
A
- shows programmer that it must stay the same
-prevents the value from being changed accidentally by a part of code
10
Q
Constants
A
- won’t change its value whilst program runs
- can be changed by a programmer before the program is compiled or translated
11
Q
Casting
A
- converts data types
12
Q
Pseudocode:
converts a string s to an integer
A
int(s)
13
Q
Inputs from the user
A
are strings
14
Q
Concatenating means
A
joining together:
15
Q
The concatenate operator is
A
+
- used to join together strings