Flashcards in Paper 2 Deck (281)
named locations that store data in which the contents can be changed during program execution
declared inside a function. They can only be accessed and used in that function.
declared outside of all the functions, they can be used throughout the whole program including inside functions.
advantages of functions
easier to create and test
self-contained units of code that perform some well-defined purpose.
a subprogram that ALWAYS returns a single value
a subprogram that returns one or many values.
the data that is supplied to a subprogram so that they can be reused
passing by reference
the address of the variable is passed to the subprogram.
if the variable is changed it stays changed.
passing by value
a copy of the variable is passed to the subprogram. The original variable is unchanged no matter what the subprogram does.
binary search precondition
the list needs to be sorted
works by dividing a list into two groups: sorted and unsorted. Elements are inserted one by one into their correct position in the sorted section.
represents reality by recognising what is important and blocking out other details
planning input and outputs e.g. caching
a temporary store where data and instructions or data that are likely to be needed are stored.
writing in modules to split a problem up into manageable tasks
inferring things from what you already know and understanding where decisions need to be made and their consequences
thinking about how a job might be done better if some parts were performed at the same time.
features of an IDE
2. colour coding/ syntax highlighting
5. watch window
6. error diagnostics
features of an IDE: Auto-complete
features of an IDE: colouring syntax
identifies different features making the code easier and quicker to check
features of an IDE: stepping
runs one line at a time to check the result, good for error checking
features of an IDE: breakpoints
stops the code at set points to check the value of variables, good for error checking
features of an IDE: watch window
tracks how variables change during the execution
features of an IDE: error diagnostics
locates and reports errors
Integrated Development Environment
What is an IDE
contains all the tools needed to write, develop and debug and program
IDE three main tools
2. build facility (automates the process of constructing a program from its component parts)
3. a debugger
Three programming constructs