PROGRAMMING Flashcards
(14 cards)
what are the 5 data types in programming languages
C - character
R - real
I - integer
B - boolean
S - string
what is casting
converting between data types. e.g. string to integer
what are the commands for casting
int(“1”) = converts string to integer
real(1) = converts integer (1) into a real (1.0)
bool(1) = converts integer (1) into a boolean value (True)
str(True) = converts boolean value (True) into the string (“True”)
what are the 3 arithmetic operators that you need to know
** = to the power of. 2**3 =8
// = DIV 20 // 3 = 6
% = MODULO 20 % 3 =2
what are the comparison operators
==, <, > , !=, <=, >=
What 2 things can data value be stored as
constants or variables
what is a constant data value
a constant is assigned a data value at design time and can’t be changed
what is a variable data value
variable is a data value that can change value throughout the program
what is the shape of a NOT
triangle and a little circle
what is the shape of a AND
a rectangle with its right side being curved
what is the shape of a OR logic gate
an curved arrow head
How can you search data
SQL
search (what you’re looking for)
from (from where, which table?)
where (what conditions? population > 1000)
what is the difference between procedures and functions
procedures don’t have to take in parameters
function has to take atleast 1 parameter
procedures don’t return a value
functions will always return a value
what are the 2 types of variable and explain
local = can only be used within the structure they’re declared in
global = can be used any time after their declaration