F452 Explain Flashcards

1
Q

Explain what the installation routine does.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain why a programmer should use good programming techniques when writing code.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain what is meant by a statement.

A

A single instruction …
… which can be executed
suitable example
Some statements can contain others (eg IF, WHILE)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain what is meant by a function.

A

A subroutine …
… which can return a single value
suitable example
So it can be used within expressions (as a variable)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the term validation.

A

Input data is checked by the computer
… against a set of rules
…to ensure that it is reasonable/sensible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain what is meant by an array.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain why an indexed sequential file is a suitable way to organise large files.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain and justify how a code can be written to make it easier to maintain.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain what is meant by a SELECT CASE statement,

A

The value of a variable is used to decide which of a number of statement blocks is executed
There can be a default option

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain the difference between a global variable and a local variable.

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain the difference between beta-testing and acceptance testing.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain the advantages of using a drop down list to enter items rather than entering them in a text field.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain what is meant by stepwise refinement.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain and justify the best practice when declaring variables and constants in code, to ensure error-free and easily understandable code.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Explain what is meant by a recursive function.

A

A function which calls itself
The original call is halted … until subsequent calls return
Eventually reaches a stopping condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain one advantage and one disadvantage of using iteration instead of recursion when writing functions.

A

Advantages
Uses only one set of variables (which are updated on each loop)/
recursion creates new variables for each call
… therefore more efficient use of memory…
… and can be faster…
… less likely to run out of stack space…
Disadvantage
Algorithm may be more difficult to follow/trace…
… because variables are being reused
You need to be careful to get the conditions of loops correct (given current state of variables)

17
Q

Explain the difference between white box testing and a black box testing.

A

In white box testing, the actual steps of the algorithm
are tested … to make sure all parts work as intended
… you need to test all possible paths through the
algorithm
In black box testing, sets of inputs are tested…
… to see if they produce the intended outputs
… you need to test all possible types of input/situations
… but how the algorithm works is not considered

18
Q

Explain the use of beta versions, and the advantages and disadvantages of their use.

A

Beta version is when the program is nearly complete.
Beta testing is when the application is made available to a small group of testers. These testers are outside the company and use the program in normal conditions who report any errors/bugs in the program and recommend desirable improvements.
Adv: program is tested using real data
program tested in normal conditions
therefore final program is more robust
Dis: Beta programs may cause damage to testers’ equipment
Analyst must agree with testers that they test the program under their own risks.

19
Q

Explain one difference between a procedure and a function.

A

A function returns a single value but a procedure does not return a value
A function is used as part of an expression whereas a procedure is used as an instruction

20
Q

Explain what is meant by a parameter.

A

A description of an item of data which is given to a
procedure/ function
… it is given a variable/name when procedure is defined

21
Q

Explain why the phone number should not be stored as an integer.

A

A phone number is not a value…
… but a sequence of digits / a string
Phone numbers may have leading 0’s…which would be lost if stored as an integer

22
Q

Explain why data in a file needs to be reset every time a program runs for the first time.

A

Needs to initialise values otherwise existing contents of a file will be used and give false results

23
Q

Explain the need for parentheses in expressions.

A

To determine or force the order in which the operations are carried and to make the expression easier to understand

24
Q

Explain why it is better to use a SELECT CASE structure, rather than IF statements.

A

SELECT CASE allows you to branch on multiple values (of the same variable)/easier to add more options
IF statements give 2 options at a time/many (nested) IF statements would be needed

25
Q

Explain what is meant by a record format and why it is used.

A

A number of data items
Can be of different data types
Grouped under a single identifier/into a single data structure
Individual items called fields…can be accessed using field names and dot notation/example such as Gymnast.Name…
Used because the data are related to each other/referring to a single entity
Allows the record details name, address, phone number etc.. to be kept together
Makes it easier to manipulate (eg save, copy, search, sort) a whole record/keeps record data in sync

26
Q

Explain the term RAD.

A

Rapid Application Development/Design
To design and create prototype (with reduced functionality)
To then show the prototype to Client
who will feedback on the features/suggest improvements
Client is allowed to change requirements along the way
Cycle is repeated (each iteration improving the program)
… until final product is produced.

27
Q

Explain what is meant by the scope of a variable.

A

That part of a program where the variable is available
e.g. whether it is local or global
A global variable is available throughout the program
A local variable only applies to a subsection/subroutine etc
If global and local variables use the same identifier, then the local takes precedence.

28
Q

Explain the difference between the command RETURN and the command OUTPUT.

A

RETURN tells to program to exit the function
and supplies the value which will be used by the main program
OUTPUT tells the program to display a value on the user interface/screen.