5. Implementing Software Solutions Flashcards

1
Q

Define Metalanguage

A

A language used to describe the syntax of other languages

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

EBNF

A

<> for variables (non-terminal elements), [] for optional, {} for 0 or more, | for or

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

Railroad Diagrams

A

Rectangles for variables (non-terminal elements), circles for literal (terminal elements — written as they appear), outward semicircle for loop, inward semicircle for or

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

Define Identifier

A

The name given to a variable, subroutine or function. They must commence with a letter

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

How are input statements used in programming?

A

Input statements are used to obtain data and store it in some variable. The source of the data may be the keyboard, a file or some other peripheral device.

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

How are output statements used in programming?

A

Output statements are used to send data to devices. This could be the monitor, printer, a file or almost any other output device.

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

Define assignment

A

The process of storing the value of an expression in a variable

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

How are assignment statements used in programming?

A

Assignment statements are used to set the value of variables and properties. Assignment is not the same as equivalence.

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

How is sequence used in programming?

A

It is the control structure that ensures each process is executed in the correct order. In most programming languages sequence is implemented by writing statements in their correct order; each statement being separated by some character.

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

How is selection used in programming?

A

By binary selection

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

How is repetition used in programming?

A

There are two types of repetition – pre-test and post-test

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

Syntax errors

A

Result when source code statements do not adhere to the rules of the programming language. All syntax errors will be detected as the source code is translated into object code.

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

Runtime errors

A

Result when for some reason the computer is unable to continue executing instructions. They can be caused by either software or hardware faults. Exceptions are types of runtime errors. Exception handlers are executed when an exception of a particular type occurs.

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

Examples of runtime errors

A

Mathematical calculations that cannot be evaluated e.g. division by zero, attempting to find the square root of negative numbers, tan 90
Inaccuracies due to non exact floating point representations e.g. 0.99999999 multiplied by 2 gives the result 2
Data that is out of the range of the identifier’s data type e.g. 16-bit integers will have a range from -32768 to 32767
Infinite calls to subroutines/recursion

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

Logic errors

A

When programs do not correctly work as anticipated. The program may continue to execute, albeit incorrectly. They are the most difficult errors to correct.

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

Examples of logic errors

A

A loop repeating fewer times than expected, resulting in some data not being processed.
Often logic errors are the cause of runtime errors
For example, a program calculates averages may cause a division by zero error if no data is input

17
Q

Define bug

A

An error or defect in software or hardware that causes a program to malfunction

18
Q

Stubs

A

A small routine that takes the place of a yet to be written subroutine or is substituted for an existing subroutine. No real processing takes place within the stub, its purpose is to allow testing of the calling routine or to assist the debugging process.

19
Q

Flags

A

A boolean variable used to check if a section of the code has been executed. Normally the flag is initialised to false and then set to true if the section of code has been executed. Often a flag will be used to confirm that a particular condition has been met.

20
Q

Debugging output statements

A

They can be strategically placed within the code to indicate execution has passed through the point. They can also be used to display the contents of variables at particular points in the code. These statements are removed once the source code has been tested and the bugs removed. Output statements are often used as part of a stub.

21
Q

Automated debugging tools

A

Breakpoints halt execution and allow the contents of variables at that point to be interrogated and even changed. Watch expressions can be used to display the contents of variables during expressions. They can also cause execution to halt when a certain condition becomes true.

22
Q

Data validation

A

It is common practice to obtain user input as string data. The string is then analysed according to the validation rules appropriate to the particular variable and context. For example, authentication, the process of identifying a user using known information, displays a form to get the username and password from the user, accesses usernames and passwords from a text file, stored passwords are encrypted using a one way hash algorithm such as SHA (Secure Hash Algorithm) so access to the text file does not reveal passwords, and checks if the user has successfully been authenticated.

23
Q

Define Call

A

To invoke a routine in a programming language. Calling a routine consists of specifying the routine name and, optionally, parameters.

24
Q

Define scope

A

The extent or range of operation of an identifier, where in a program, a given identifier may be accessed.

25
Q

Local variables

A

Local variables can only be accessed by the subroutines in which they are declared. In this case other subroutines are unable to directly access these variables. An instance of the local variable is created as the subroutine begins execution and is destroyed once the subroutine ends.

26
Q

Global variables

A

Variables that are available to other modules within the project. They are created as the program starts and are only destroyed when the program finally ends.

27
Q

Parameter passing

A

In most cases the variable used as a parameter is not passed, rather a copy of the data is held in the variable or the address in memory of the variable is passed. This is known as passing “by value” or passing “by reference” respectively.

28
Q

Define readability

A

The ease with which the written word can be read and understood

29
Q

Use of whitespace

A

White space should be a neutral colour that does not attract or draw the user’s attention. It breaks up the screen into sections and draws the user’s eye to important elements.

30
Q

Judicious use of colour and graphics

A

Graphics used as icons should deliver a clear message to the user as to their purpose. Effective icons communicate their purpose more quickly than the equivalent text. Coloured text should be used sparingly and only where it has some purpose or message to deliver.

31
Q

Grouping of information

A

It makes sense to logically group related items together. They can then focus on the required elements more efficiently. Grouping normally is accomplished using frames or borders, which can be used in conjunction with a label.

32
Q

Legibility of text

A

Refers to the user’s ability to make out each word and or character. How font is justified or aligned on the screen influences legibility.

33
Q

Effective prompts

A

A prompt is a reminder or a cue as to what is required. Prompts are the main method of communicating with users. Most screen elements contain or are linked to prompts.

34
Q

Unambiguous and non-threatening error messages

A

Messages are used to provide further information. Error messages are used to inform the user of some problem that has occurred. Error messages should identify the error and also provide some solution in a non-threatening way.

35
Q

Provision of feedback

A

Feedback to users is crucial and should appear to be instantaneous. The user should never be left wondering whether their actions have been successful. Feedback is provided intuitively as the processing results in some obvious change to the interface or data.

36
Q

Consistency of design

A

Consistent user interfaces are easier to learn and are therefore easier to use

37
Q

Internal documentation

A

It is designed to make the programming code readable. Internal documentation aims to help programmers understand source code; it is purely for the benefit of programmers. The use of identifier names that describe their purpose is often called intrinsic documentation.

38
Q

Online help

A

Most commercial applications provide online help. The major advantage of online help compared to printed documentation is that it can be context sensitive.