F452 Explain Flashcards
Explain what the installation routine does.
The program is copied to a designated folder on the target computer
Any necessary data files are copied
Any necessary library files are copied and registered
Shortcut / icon created to run the program easily
User has the opportunity to configure program / run settings
And configuration is saved in a file / registry
Programs may need extracting from a compressed file
Explain why a programmer should use good programming techniques when writing code.
Enables teams of programmers to work collaboratively
… code split into modules / blocks which are easier to maintain
/ debug individually
… conventions used to ensure everyone understands program
Code can easily be read by other programmers / at a future
date
… Indentation clearly shows structure of code
… meaningful identifiers make code easier to read /
understand
Program is less error prone
… it is internally documented / comments can be compared
with logic
… and is easier to trace / debug
… code is easier to read/closer to pseudocode
Explain what is meant by a statement.
A single instruction …
… which can be executed
suitable example
Some statements can contain others (eg IF, WHILE)
Explain what is meant by a function.
A subroutine …
… which can return a single value
suitable example
So it can be used within expressions (as a variable)
Explain the term validation.
Input data is checked by the computer
… against a set of rules
…to ensure that it is reasonable/sensible
Explain what is meant by an array.
A data structure / set of data items
Of the same data type
Grouped under one identifier
Each item can be addressed using its index/subscript.
Explain why an indexed sequential file is a suitable way to organise large files.
Records are arranged in order of a primary
key which in this case will be (say whatever it is in the scenario)..
An index is kept which is used to jump to
groups/blocks of records
e.g. the index could hold the positions of the first record
with letters A, B, C etc.
The index must be in the same order as the records
Could have multiple indices
Given the large number of records accessing a specific record is faster using the index/key as you do not have to search sequentially from the beginning.
Explain and justify how a code can be written to make it easier to maintain.
The variables/procedures should be given more
descriptive names using consistent conventions (uppercase for first letter, no spaces, instead use underscore, data type) making it easier to tell what the variables represent/procedures do.
Code should be indented to show program
constructs/blocks for example PROCEDURE/END PROCEDURE making it easier to trace the code and check for incorrect blocks
Add comments to the code and separate it into logical sections making the code easier to read
Explain what is meant by a SELECT CASE statement,
The value of a variable is used to decide which of a number of statement blocks is executed
There can be a default option
Explain the difference between a global variable and a local variable.
A global variable is declared at the beginning of a
program
… and is available throughout the program
A local variable is declared within a subprogram/
procedure/function/block of code
… and is only available within that section of code
… and is destroyed/deleted when the subprogram
exits
A local variable can override a global variable (with
the same name)
Explain the difference between beta-testing and acceptance testing.
In beta-testing…
… the nearly complete program…
… is given to a group of users to test/is tested under
normal operating conditions/tested by people who
were not involved in the production
The aim is to find any bugs which the programmer has
overlooked
In acceptance testing…
… the program is considered complete
The programmer demonstrates the working program
to the client
The aim is to show that the program meets all the
requirements of the client.
Explain the advantages of using a drop down list to enter items rather than entering them in a text field.
Used for validation…
… as it provides an existence check/ to ensure that only teams in the competition can be entered
Prevents typing errors…
… being entered as a different team
Allows faster input…
… as operator does not need to type in the name of the team
Explain what is meant by stepwise refinement.
Each module/task is defined in simple terms…
… and then split into a number of smaller sub-modules/sub-tasks…
… which are successively split…
… until each is small enough to be programmed
Explain and justify the best practice when declaring variables and constants in code, to ensure error-free and easily understandable code.
Identifier names should describe the item identified…
Declarations should be made obvious within the code …
… for examples by using comments with explanations of their purpose
… or separating them from code with blank lines
… so that they can easily be found, if you need to refer to them while reading the code
Standard conventions should be used
… such as CamelCase/underscores/type prefixes
… as most translators do not allow spaces in identifier
Keyword/reserved words in the language should be avoided … eg you should not have a variable called Print/Count/Array
… the translator will interpret this as the keyword and produce a syntax error (otherwise keyword violation error)
Declare constants and use these in the code instead of literals … code is easier to understand because the name of the constant … if the value changes, you only need to change it in the declaration of the constant instead of looking for every instance of the literal
Variables/Constants should be declared as local wherever possible
… reducing the scope/lifetime of the variable to the minimum necessary
… avoiding errors due to clashing variable names in different parts of the program
Initialise variables when declared… e.g. int i = 1; string New = “”; … this ensures that a suitable value is in the variable at the start of your algorithm
Explain what is meant by a recursive function.
A function which calls itself
The original call is halted … until subsequent calls return
Eventually reaches a stopping condition