Save
...
Paper 2
2.2 Programming Fundamentals
Theory Questions
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Pav Bath
Visit profile
Cards (31)
What is the fundamental sequence in programming?
Code
runs
from
top
to
bottom.
View source
What does the term 'selection' refer to in programming?
Making a decision or choice based on a
Boolean
expression.
View source
What is a Boolean expression?
An expression that has to be
true
or false.
View source
What is iteration in programming?
Repeating
blocks
of
code.
View source
What are the two types of loops in iteration?
For
loops and
while
loops.
View source
What is a counter-controlled loop?
A loop that repeats a
specific
number of times using a counter.
View source
How would you write a for loop that repeats code 10 times in Python?
For i in
range
(10):
View source
What is a while loop?
A loop that continues as long as a
Boolean
condition is true.
View source
What is a variable in programming?
A
storage location
that
can
be
changed.
View source
What is a constant in programming?
A
storage location
that doesn't
change.
View source
What is the value of Pi as a constant?
Pi =
3.14
View source
What is a string in programming?
Alphanumeric
text enclosed in speech marks.
View source
What is an integer?
A
whole number
.
View source
What is a float or real number?
A
decimal number
.
View source
What does a Boolean represent?
True
or False.
View source
What is a char in programming?
A
single
character.
View source
What is a syntax error?
An error that occurs due to incorrect
grammar
or layout in code.
View source
What is a logic error?
An error where the code runs but does not produce the
expected
output.
View source
What does 'mod' or 'modular' refer to in programming?
Division where the
remainder
is returned.
View source
What is the result of
16
m
o
d
3
16 \mod 3
16
mod
3
?
1
1
1
View source
What is the symbol for mod in Python?
%
View source
What does 'Div' refer to in programming?
Division
where the
whole number
is
returned.
View source
What is the result of
16
Div
3
16 \text{ Div } 3
16
Div
3
?
5
5
5
View source
What is the symbol for Div in Python?
//
View source
What is a subroutine in programming?
A module of code that can be
reused.
View source
What are the benefits of using subroutines?
They help break down
problems
and make code easier to
maintain
.
View source
What are the two types of subroutines?
Functions
and
procedures
.
View source
What does a function do?
Returns a
value
.
View source
What does a procedure do?
Does not return a
value
.
View source
What is data casting?
Changing
data types
.
View source
What is concatenation?
Joining multiple
strings
together.
View source