Save
Computer Science
Section 6- Programming
Save
Share
Learn
Content
Leaderboard
Learn
Created by
Khloe
Visit profile
Cards (74)
What are the main data
types
?
Integer, real (or float), boolean, character, string
What is an integer?
Whole number
What is a real?
A
decimal
number
What is a boolean?
Data that can only represent
two
values (
true
or
false
)
What is a character?
A single
letter
,
number
or
symbol
What is a string?
A collection of
characters
What is casting?
Functions that
allow
you to
convert
between
data
types
What are the codes for casting?
int()
-changes to an integer
bool()
-changes to a boolean
real()
-changes to a real
str()
-changes to a string
ASC()
-changes to an ASCII number
CHR()
-changes to a character
What is the operator addition?
+
What is the operator for subtraction?
-
What is the operator for
multiplication
?
*
What is the operator for division?
/
What is the operator for exponentiation (squaring)
**
What is the operator for quotient or the whole number part of division?
DIV
What is the operator for finding the
remainder
?
MOD
or
%
What is the assignment operator and what does it do?
=
Assigns
values to
constants
or
variables
What is the comparison operator for 'is equal to'?
=
=
What is the
comparison operator
for 'not equal to'?
!=
What is the comparison operator for 'less than'?
<
What is the comparison operator for 'greater than'?
>
What is the comparison operator for 'less than or equal to'?
<=
What is the
comparison
operator for 'greater than or
equal
to'?
>=
What can data values be stored as?
Constants
or
variables
What is a constant?
An
assigned
data value that
can't
be changed (if attempted to assign a new
value
it will return an
error
)
What is a variable?
An
assigned data
value that can be
changed
Where are strings written?
Inside
quotation
marks
What is concatenation?
Where strings are
joined
together to form
new
strings
What function changes all characters to upper case?
x.upper
What function changes all characters to lower case?
x.lower
What function that returns the number of characters?
x.length
What function extracts the first number (i) of characters from the string?
x.left(
i)
What function extracts the last number (i) of characters from the
string
?
x.left
(i)
What function extracts a string starting at position a with length b?
x.substring
(a, b)
What does an if statement do?
Allows you to check if a
condition
is
true
or
false
, and the next
action
is
dependant
on that
result
What is a nested if statement?
Allows you to check more
conditions
once you've
established
that the previous
condition
is
true
What is the code to use a nested if statement?
if
-
elseif
statements
What do switch statements do?
Can check the
value
of a variable
What is a for loop?
An example of a
count
controlled loop (loop will repeat a
fixed
number of times
What is an example of a for loop?
for k =
1
to
100
What are condition controlled loops?
DO UNTIL
WHILE
See all 74 cards