2.2 Problem solving and programming extra Flashcards
Explain the term procedural programming language
High-level language
Gives a series of instructions in a (logical)
order / line by line / what to do and how to
do it
What is high level also known as
Imperitive
Describe the use of local variables
High-level language / 3GL / imperative
language
Gives a series of instructions in a (logical)
order / line by line / what to do and how to
do it
What distinguishes global variables from local
Defined at start of program
Exists throughout program / in all
modules
Allows data to be shared by modules
What is a variable
Identifier/name of a …
Memory location used to store data
What is scope
A range of
statements/procedure/function/method
that a variableis valid for
A local variable takes precedence over
a global variable of thesame
name/allow the same identifier to be
used for different purposes without
conflic
Explain the advantages of writing an application using a modular approach.
Work is easier to divide between a
team
each team member just needs to know
what values go into their subroutine
and the expected functionality
Saves time as work takes place in
parallel
each team member can work on their
area of expertise.
Breaks problems into smaller areas.
Easier to test/ debug/ read
each subroutine can be tested before
integration.
Code can be reused in the project/
future projects
Some features of IDE’S
Auto-complete
Can view identifiers / avoid spelling
mistakes
Colour coding text / syntax highlighting
Can identify features quickly / use to
check code is correct
Stepping
Run one line at a time and check result
Breakpoints
Stop the code at a set point to check
value of variable(s)
Variable watch / watch window
Check values of variables and how
they change during the execution
Error diagnostics
Locate and report errors / give detail on
errors
Explain why the array scores has been declared as global instead of local
It does not need to be passed between
subroutines
It can be accessed/updated at any
point/place in the program
It allows it to be updated as a running
total
local and global
Memory, local/parameter allows re allocation of memory but in recursion more memory needed as 1 memory space for each call if local/parameter
What can IDE debugging produce
A crash dump which shows the state of variables at the point where an error occurs
What can an IDE display
stack contents which can show the sequencing through procedures/modules
What does an IDE inserting a breakpoint allow
The program to be stopped at a predetermined point in order to inspect its state
Describe what is meant by the term IDE (Integrated Development Environment)
A (single) program (1) used for
developing programs (1) made from a
number of components (1).