9.2.3 Implementing Flashcards

1
Q

What is the difference between a rounded rectangle and a normal rectangle in railroad diagrgams?

A

Rounded rectangle indicates a literal.

A normal rectangle indicates an element that needs to be defined elsewhere.

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

What do curly braces represent in EBNF?

Write down some examples of the statement a { b }

A

A repetition of the the elements inside zero or more times.

a { b } would represent: a, ab, abb, abbb etc.

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

What do square brackets mean in EBNF?

Write down the possible statements defined by a [b] c

A

An option (zero or once).

a [b] c would be either abc or ac.

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

In EBNF, how can you specify that an element must repeat one or more times?

For example, how could you describe

hi, hii, hiii, hiiii etc.

A

By including the element as a literal, followed by a zero or more time loop (curly brackets).

That is, h i { i }

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

What are parentheses used for in EBNF?

A

As a grouping symbol, to remove any possible ambiguity in a rule.

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

How do you specify a choice between options in EBNF?

A

With a vertical line.

For example, x ( + | - ) y could be x + y or x - y

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

In EBNF, how do you specify a symbol that requires further definition elsewhere?

(This is also called a non-terminal symbol)

A

Using angled brackets.

For example, in the rule if then, if and then are literals while condition is defined elsewhere.

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

What is the only type of code that can be executed by a computer?

A

Machine code: commands written in binary that are specific to each processor (or family of processors).

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

What is assembly language?

A

A low-level language that is processor-dependent. It uses text codes (“opcodes”) to perform arithmetic functions and access processor registers.

Each opcode in assembly corresponds to one machine code instruction, but is (very slightly) more readable.

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

What does translation refer to?

A

The process of converting human readable (high-level) languages into machine code.

The 2 forms of translation are interpretation and compilation.

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

Describe how an interpreted language is executed.

A

The interpreter executes each line of source code as it is read.

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

Describe how a compiled language works.

A

A compiler analyses the entire source code and creates an executable file.

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

Outline the advantages and disadvantages of compilation and interpetation.

A

Interpretation

  • Advantages
    • Code can be executed quickly so development can happen quickly.
  • Disadvantages
    • Slower to execute.
    • Source code is not protected.
    • Intepreter needs to be distributed along with the source code to end users.

Compilation

  • Advantages
    • Code typically runs faster.
    • Hard to reverse engineer - source code is protected.
  • Disadvantages
    • Developing/testing takes longer, having to compile after each change.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the 3 stages involved in translation?

A
  1. Lexical analysis
  2. Syntactical analysis
  3. Code generation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Outline the process of lexical analysis.

A

Each word in the source code is checked to see if it is part of the language.

The words are converted into tokens to represent parts of the langugae and user-defined variable names.

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

Outline the process of syntactical analysis.

A

The source code is analysed to ensure it follows the syntax of the language.

This is achieved by creating a parse tree from the tokens generated in the previous stage. A parse tree is a visual representation of a syntactically correct statement.

17
Q

Outline the process of code generation

A

The correct parse tree containing the tokens is converted to machine code.

18
Q

What is the function of a linker?

A

In the code generation stage of translation, the linker adds any links to library files used by the source code.

19
Q

What is a DLL?

A

A dynamically linked library, which contains compiled library functions that can be used by other programs. DLLs are accessed at run time, compared to static libraries which are compiled with the source code.

20
Q

Outline the three types of errors that can occur.

A
  1. Syntax errors - incorrect use of the programming language
  2. Logic errors - syntactically correct code that does not meet the objective of the code.
  3. Runtime errors - errors that occur during the execution of the program.
21
Q

Outline the 3 types of runtime errors that can occur

A
  1. Arithmetic overflow - when a value is assigned outside a the range allowed for that data type.
  2. Dvision by zero
  3. Accessing inappropriate memory locations - attempting to access an array index beyond the length of the array for example.
22
Q

What hardware requirements must be considered when implementing a software solution?

A
  • Requirements of existing hardware, like amount of RAM/hard disk space and CPU.
  • Additional software needed, like graphics card/sound card, or peripherals like a barcode scanner.
  • Software drivers to communicate with required hardware.
23
Q

Related to hardware, what is a driver?

*As opposed to a driver related to <em>testing a subroutine or library module</em>

A

Software that allows a computer program to operates or controls a particular type of hardware device

24
Q

How might CASE tools be used to produce different types of documentation for a software solution?

A

CASE tools would likely not be used for user documentation (eg user manual, installation guide etc).

CASE tools could be used for technical documentation such as:

  • Source code
  • Algorithms
  • System models
  • Documentation of changes
25
Q

Outline 4 software tools for error detection & correction

A
  1. Breakpoints - pause execution of the program at a particular line of code.
  2. Single line stepping - controlling the flow of execution, one line at a time.
  3. Resetting variables - editing the values of variables during execution.
  4. Program traces - any kind of program tracking. This could be the statements
26
Q

Outline 5 types of user documentation

A
  1. Installation guide - steps for installing the program
  2. User manual - instructions on how the use the program, generally presented in an appealing way. Possibly organised to cover common and easier tasks before moving on to more advanced topics.
  3. Reference manual - not designed to be read through. Possibly organised alphabetically for efficient access.
  4. Tutorials - a set of steps to achieve a specific outcome.
  5. Online help - link to any of the above via the internet.
27
Q

Outline 3 types of technical documentation

A
  1. Log book - document the processes and decisions made in development.
  2. Comments in source code - documenting purpose of subroutines and arguments/return values, details of specific logic, etc.
  3. Intrinsic documentation - variable names, indentation, etc.
28
Q
A