Programming (Paper 2) Flashcards
What are the data types?
-INTEGER
-REAL
-CHAR
-STRING
-BOOLEAN
What is a variable?
A data item held in memory which may change value during the program execution
-It is referred to by its identifier
What is an INTEGER?
A whole number
Example = 5,10,57,18
What is REAL?
A number with a decimal point
Example = 1.4, 3.15, 56.0
What is CHAR?
A single character enclosed in single quotes
Example = ‘A’, ‘+’, ‘1’, ‘@’
What is STRING?
Zero or more characters enclosed in double quotes
Example = “Yes”, “Hello”, “Marcus”
What is BOOLEAN?
The logical values TRUE or FALSE
Example = TRUE, FALSE
What is a constant?
A value that cannot change during the execution of the program
How would you write an input output statement in pseudocode?
OUTPUT “….”
INPUT ….
What are the arithmetic operators and what do they mean?
+ = addition
minus symbol = subtraction
/ = division
astrix = multiplication
^ = to the power of
MOD = remainder
=DIV = Quotient
What are the logical operators and what do they mean?
= = equals
<= less than
<= = less than or equal to
> = greater than
=> = greater than or equal to
<> = not equal to
What is a sequence statement?
Two or more statements written and executed one after the other in sequence
What is a selection statement?
A selection statement comprises an IF or CASE statement and a logical expression
What do selection statements contain?
IF
THEN
ENDIF
IF
THEN
ELSE
ENDIF
or
CASE OF
OTHERWISE
ENDCASE
Write a nested if statement
Check textbook
Write a case statement
Check textbook
What is an iteration statement?
Iteration means repetition and iteration statements comprise of FOR loops or Count controlled loops
Write a count controlled loop
Check textbook