Constants, variables and data types Flashcards
What is a variable?
A variable is a label for stored information that can change while the program is running
What is a constant?
A constant is label for stored information that cant change while the program is running
Which data type stores whole numbers?
Integer
Which data type stores text?
String
Which data type only has two possible values?
Boolean (true or false)
Which data type can store a single letter (or number, symbol etc)
Character (char)
Which data type stores any numbers including fractions?
Real (sometimes called float)
Which data type would you use to store 15/4/12?
Date/Time
Which data type would you use to store 20:15?
Date/Time
Which data type would you use to store 4 September 2014 13:30 ?
Date/Time
What characters can you start a variable name with?
letter or underscore
What characters can you use in the main part of a variable name?
letter, number, underscore
True or false? if a is true and b is true, a AND b is…
true
If A is false and B is false then A AND B is…
false
if A is false and B is true then A and B is….
false