Save
...
Paper 2
Programming Fundamentals
Programming Fundamentals
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Caylin Hindle
Visit profile
Cards (32)
What are the three programming constructs?
Sequence
,
Selection
,
Iteration
View source
What does the sequence construct do in programming?
It
structures
code in
logical
order
View source
How does the selection construct function in programming?
It uses
if statements
for decision making
View source
What is the purpose of the iteration construct?
To repeat code using
loops
View source
What is the role of variables in programming?
To store
data
in programs
View source
What are the two parts of a variable?
Data value
and
identifier
View source
Why should variable names be sensible?
To clarify their purpose in the
program
View source
What is an example of a sensible variable name?
First_Name
View source
What are local variables?
Declared within a specific
subroutine
View source
What are global variables?
Used anywhere in the whole
program
View source
What is an advantage of local variables?
They save
memory
when not in use
View source
Why are local variables easier to debug?
They can only be changed in one
subroutine
View source
What is an advantage of global variables?
They can be used in multiple
subroutines
View source
What is a constant in programming?
Data
that
does
not
change
in
value
View source
Give an example of a constant.
Pi
(3.14159)
View source
What are comparison operators used for?
To compare two
data values
View source
What are arithmetic operators used for?
To mathematically
manipulate
values
View source
What is the addition operator symbol?
+
View source
What is the
subtraction
operator
symbol?
View source
What is the multiplication operator symbol?
*
View source
What is the division operator symbol?
/
View source
What does modulo division do?
Reveals the
remainder
from division
View source
What does integer division reveal?
The
whole number
of times a number divides
View source
What does the symbol
^
represent?
Exponentiation
in some programming languages
View source
What does Python use for exponentiation?
**
View source
What are logical operators used for?
To work with
TRUE
and
FALSE
values
View source
What is the term for TRUE and FALSE values?
Boolean
View source
What are the three programming constructs and their functions?
Sequence
: Structures code in logical order
Selection
: Uses if statements for decision making
Iteration
: Repeats code using
loops
View source
What are the differences between local and global variables?
Local Variables
:
Declared within a specific
subroutine
Used only within that subroutine
Global Variables:
Used anywhere in the program
Declared once for the
entire program
View source
What are the advantages of local and global variables?
Local Variables:
Save memory when not in use
Easier to
debug
Global Variables:
Used in multiple
subroutines
Easier
maintenance
View source
What is the difference between variables and constants?
Variables: Data that can
change
value
Constants: Data that remains
fixed
in value
View source
What are the types of operators in programming?
Comparison Operators
: Compare two data values
Arithmetic Operators
: Mathematically manipulate values
Logical Operators: Work with TRUE and
FALSE
values
View source