Variables, Constants and Data types
By
Vuyisile Memani
Faculty of ICT
Department of Computer Science
,Variables
A variable is a container that can store data of a specific type.
The data can change, but the container stores one value at a
time.
There are rules to be followed in naming variables.
Faculty of ICT
Department of Computer Science
, Naming convention of variables
A variable name must be highly descriptive of the value it will
store.
Example
Create two variables, one to store the name of a person and
the other to store the price of an item. Let the person’s name
be “Vuyisile” and the item’s price be R20.50.
Answers
name = “Vuyisile” , price = 20.50
Faculty of ICT
Department of Computer Science
By
Vuyisile Memani
Faculty of ICT
Department of Computer Science
,Variables
A variable is a container that can store data of a specific type.
The data can change, but the container stores one value at a
time.
There are rules to be followed in naming variables.
Faculty of ICT
Department of Computer Science
, Naming convention of variables
A variable name must be highly descriptive of the value it will
store.
Example
Create two variables, one to store the name of a person and
the other to store the price of an item. Let the person’s name
be “Vuyisile” and the item’s price be R20.50.
Answers
name = “Vuyisile” , price = 20.50
Faculty of ICT
Department of Computer Science