Back to marketplace

programming concepts (paper 2)

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

what happens to data used in a program

Back (Answer)

it is stored in memory locations while the program is running

#2
Front (Question)

what is a variable

Back (Answer)

a data item held in memory which may change value during program execution

#3
Front (Question)

what is a variable referred to by

Back (Answer)

its identifier

#4
Front (Question)

what are the different types of data variable can be

Back (Answer)

• integer (5, -297) • real (3.12, 9.999) • char (A, @, $, 4) • string (Yes, Hello world) • boolean (TRUE, FALSE)

#5
Front (Question)

what is a constant

Back (Answer)

a value that cannot change during the execution of hte program (CONSTANT VAT <- 0.2)

#6
Front (Question)

what is the diifference between a variable and a constant

Back (Answer)

a variable can change during the program execution, a constant does not

#7
Front (Question)

what is an input

Back (Answer)

when the user inputs data or a request into the program to get an output (INPUT Name)

#8
Front (Question)

what is an output

Back (Answer)

it is used to output data on the screen after information has been processed by the user (OUTPUT “Area = “, Length * Width)

#9
Front (Question)

what is a boolean expression

Back (Answer)

something which uss one or more logical operators and evalutes to either TRUE or FALSE

#10
Front (Question)

what is a sequence control structure

Back (Answer)

when two or more statements are written and executed one after the other in sequence

#11
Front (Question)

what is a selectrion control structure

Back (Answer)

comprises an IF or CASE statement and a logical expression (CASE OF… OTHERWISE… ENDCASE…, IF… THEN…)

#12
Front (Question)

give an example of a nested if statement

Back (Answer)

IF Num1 >= Num2 AND Num1 >= Num3 THEN OUTPUT Num1 ELSE IF Num2 >= Num1 AND Num2 >= Num3 THEN OUTPUT Num2 ELSE OUTPUT Num3 ENDIF ENDIF

#13
Front (Question)

what does a case statement actually allow to happen

Back (Answer)

one of several brances of code to be executed depending on what data has been inputed by the user

#14
Front (Question)

give me an example of a case statement

Back (Answer)

INPUT MemberType CASE OF MemberType “Junior” : EntryFee <- 2.0 “Senior” : EntryFee <- 3.0 “Special” : EntryFee <- 0.0 OTHERWISE OUTPUT “Invalid member type” ENDCASE

#15
Front (Question)

what does iteration mean

Back (Answer)

repetition

#16
Front (Question)

what loop is count-controlled

Back (Answer)

FOR… NEXT

#17
Front (Question)

give an example of a FOR.. NEXT loop nested

Back (Answer)

FOR Table <- 2 TO 10 FOR N <- 1 TO 10 Answer <- Table * N OUTPUT Answer NEXT N NEXT Table

#18
Front (Question)

what loop is condition controlled

Back (Answer)

WHILE… DO … ENDWHILE (pre-condition - checked at the start) REPEAT… UNTIL (post-condition - checked at the end)

#19
Front (Question)

Give an example of a WHILE… DO… ENDWHILE loop

Back (Answer)

Total <- 0 Days <- 0 INPUT Visitors WHILE Visitors <> -1 DO Total <- Total + Visitors Days <- Days + 1 INPUT Visitors ENDWHILE Average <- Total / Days OUTPUT “Average daily number of visitors:” OUTPUT Average

#20
Front (Question)

how is a string defined

Back (Answer)

as zero or more characters enclosed in quote marks (“”)

#21
Front (Question)

what are the different string functions and what do that do

Back (Answer)

• LENGTH(“ “) = returns the number of characters (including spaces) • LCASE(“ “) = makes everything in parameter lower case • UCASE(“ “) = makes everything in parameter upper case • SUBSTRING(“ “, Num, Num) = makes everything in the quote marks outputed between the two numbers

#22
Front (Question)

what is a procedure

Back (Answer)

a named block of code, seperate from the main program, which can be called and executed using a statement like (CALL <procedure>)</procedure>

#23
Front (Question)

what does a procedure do

Back (Answer)

• it does not return a value • control is passed using the CALL statement with any parameters in brackets

#24
Front (Question)

what is a function

Back (Answer)

a block of code which returns a value to a variable specific in the statement (eg you would have a function just for calculating the total of smt or the avergage)