Karteikarten
FMJC.C7
Karten in diesem Stapel (20)
- 1Why should you break down complex tasks into smaller sub-tasksEach function coded, tested individually
Complex code given to experts
Function interaction can be tested before adding together to solve problem
Group of functions can be placed
together to form libraries which
can be re-used - 2How functions and procedures may be used to develop a program in a structured mannerEach module written as a functional procedure
...which can be tested individually
Library routines
Code is reusable
Program consists of calls to func/proc
...which may be nested - 3What is a functionIs a procedure that returns a value
...associated with its name
Block of code
Uses local variables - 4What is a procedureIs a procedure that may or
may not return a value...
Block of code
Uses local variables - 5What is stepwise refinementBreaks a problem into sections
...which become progressively smaller
...until each module can be written as a single procedure or function
Each module can be tested
Library routines can be tested - 6What is a local variableVariable defined within one part of program and only accessible in that part
Data contained is lost when execution of section has completed
Same variable name can be used in different modules - 7What is a global variableA variable that is defined at the start of the program and exists throughout
..including functions and procedures
Allows data to be shared between modules
Local variable override Global *same name - 8What are parametersInformation about an item of data
...supplied to a function or procedure
Can be passed by reference or by value
Used as a local variable
ByRef = Safer
Allows data to be transferred - 9Explain the term parametersInformation about an item of data
..supplied to a procedure or function
May be passed by reference or by val
Used as a local variable - 10What type of data structure deals with procedure calling and parameter passing?Stack
- 11What data structure is used when procedures are called during program executionStack
- 12State the purpose of a stackSo program can return correctly when procedure has finished
Store return address
Allows data to be transferred - 13State the need for Backus-Naur Form (BNF)To unambiguously define the
syntax of a language - 14State the purpose of syntax diagramsTo define terms unambiguously
for a computer language - 15Give the name for another notation that can be used instead of syntax diagrams to define the languageBackus-Naur Form
- 16When traversing a binary tree using reverse polish, what direction should be takenPost order (Traversal)
*achieved by drawing a line around* - 17What data structure other than binary tree may be associated with reverse polish notationStack
- 18What symbol is not needed in reverse polish notationBrackets
- 19Advantage of using Reverse Polish NotationAny expression can be processed
(from left to right)
No rules of precedence
No need for brackets
Unambiguous - 20Type of Tree Traversal that should be used when using binary tree'sPost order
Informationen
- Beschreibung
- Karteikarten am FMJC.C7, erstellt von FMJC. am 18/06/2015.
- Erstellt von
- FMJC.
- Aufrufe
- 1
- Bewertung