Grade 9 - Computer Logic-Formulation-Variables
Grade 9 - Computer Logic-Formulation-Variables
FORMULATION
GAME DESIGN AND DEVELOPMENT
OBJECTIVES
DECLARING NAMING
A VARIABLE RULES
Declaring a Variable
02
DATA TYPES
Logic Formulation
DATA TYPES
string Collection of characters that is used represent a text.
bool (boolean) Logical data type that can have only the values true or false.
10
10 20
10 20 (15+15)
“mike”
“mike” “barb”
“a”
int Array
(Variable)
***Invalid, our Array is integer (int).
ARRAY
1 3 5 8 9 10
0 1 2 3 4 5
int Array
Items = 6
(Variable)
length = 5
ARRAY
1 3 5 8 9 10
0 1 2 3 4 5
int Array
Items = 6
(Variable)
length = 5 length = no. of items - 1
BOOLEAN OPERATOR
< Less than 3 < 5 (true), 5 < 3 (false), 4 < 4 (false), 3 < 3.5 (invalid)
> Greater than 3 > 5 (false), 5 > 3 (true), 4 > 4 (false), 3 > 3.5 (invalid)
<= Less than equal to 3 <= 5 (true), 5 <= 3 (false), 4 <= 4 (true), 3 <= 3.5 (invalid)
>= Greater than equal to 3 >= 5 (false), 5 >= 3 (true), 4 >= 4 (true), 3 <= 3.5 (invalid)
name last_name
_name last_name_
1name _last_name_
*name
EXAMPLES
License license
Date of Birth dateOfBirth
EXAMPLES
EXAMPLES
04
VARIABLE ASSIGNMENT
Logic Formulation
VARIABLE ASSIGNMENT