Problem Solving and Programming Flashcards
What is the purpose of an IDE
A program which provides a set of tools to make it easier for programmers to write, develop and debug code.
What is the purpose of stepping
This allows you to monitor the effect of each individual line of code by executing a single line at a time.
What is the purpose of variable watch
Sometimes used to pinpoint errors, this is a useful feature to observe how the contents of a variable change in real-time through the execution of a program.
What is the purpose of breakpoints
IDEs allow users to set a point in the program at which the program will stop. This can either be based on a condition or set to occur at a specific line. This can help to pinpoint where an error is occurring.
What is the purpose of a source code editor
The editor aims to make the coding process easier by providing features such as autocompletion of words, indentation, syntax highlighting and automatic bracket completion.
What is the purpose of debugging tools
Some IDEs also provide run-time detection of errors with a guide as to where in the code they are likely to have occurred through line numbers and highlighting.
What are parameters
The values passed into a function
What are procedures/ functions
Procedures and functions are both named blocks of code that perform a specific task.
What is the difference between procedures and functions
Procedures do not have to return a value; functions must always return a value.
Procedures can return multiple values whereas a function must return one, single value
What happens when we pass a parameter by value
When a parameter is passed by value, the value created for the subroutine being called is a copy of the original. Once it is passed, the parameter is held in a separate memory location, so is only available to that subroutine meaning the copy is now a local variable of that subroutine
What happens when we pass a parameter by reference
When a parameter is passed by reference, a pointer that contains the memory address of the original variable is created
This means that any changes to that value from within the called subroutine will also affect the original variable
What is a variable
Identifier of a memory location used to store data
What is meant by the scope
The range of statements/ procedures/ functions/ methods that a variable is valid for
What is a global variable
A type of variable, usually defined at the start of a program, where the variable can be used everywhere in the program
What are local variables
A variable that is only valid within the procedure/ function/ sub routine in which they are declared