Term 2 | Practical | Chapter 3 Flashcards
What does a variable refer to in IT?
A variable refers to a memory location that can store data of a particular
data type. Just like variables in Mathematics, variables in programming
can only hold one value at a time.
What symbol do we use to indicate that the variable is a string
Single Quotation
‘ ‘
Fill in the blanks
______represents a single character, such as a letter, symbol or digit.
Char
What is the purpose of integer in coding
Integers can be used in numerical calculations
eg
5
-85
What is a real number?
A real number is a positive or negative decimal number. You can perform numerical calculations on real numbers. For Example:
- 68.9
5. 0
What is a Boolean?
A Boolean value can only be one of two values, that is, it can either be True or False. This is often used in programs
where a specific task is only complete if a specific condition is met.
NOTE:
● Boolean values are not included in single quotation marks because they are not strings.
Which one is a real number?
-7 OR 5.6
5.6
What is a string?
a. a type of variable that hold data values made up of ordered sequences of
characters
b. a data type that holds letters
c. a type of variable that hold characters
C
Variable names should use CamelCase. What does this mean?
This means the first word or letter is in
lowercase, and each word afterwards starts with an uppercase letter, for
example, rAmountPaid
What are the naming conventions for componets
●component names should describe the task they will
perform or the data
they will hold
● names should use CamelCase.
● component names should start with a three letters prefix that describes the
component type.
Before you can use a variable in Delphi, what should you do?
You must first tell delphi to reserve a space for it, In other words, declare a varaible
The____statement is used to tell Delphi that variables will be declared
var
True OR False
Multiple variables of the same type can be declared on one line, as long as
they are separated by commas
True
How do you declare a component?
You don’t. When you place a component onto a form, Delphi automatically inserts the declarations in the Type
section of the code.
What do you call this symbol?
:=
Assignment operator