Programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the standard algorithms?

5

A
  • Input Validation
  • Count Occurence
  • Linear Search
  • Find Min
  • Find Max
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Standard Algorithms:

Input Validation Code

A

start fixed loop
get input from user
conditional loop - while input not match conditions
display error message
get input from user
end conditional
end fixed loop

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

Standard Algorithm:

Count Occurence Code

A

total = 0
get value from user
fixed loop
if array index = value
total = total + 1
end if
next
display message

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

Standard Algorithms:

Linear Search Code

A

found = false
counter = 0
get search value input
Do
if searchValue = array index then
found = true
msgbox(“The program found the value at position “ & counter)
else
counter = counter + 1
endif
loop until counter = end of array or found = true
if found = false
display message
end if

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

Standard Algorithms:

Find Min

A

min = first array index
fixed loop
if array index is less than min then
assign value to min
end if
next
display message

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

Standard Algorithms:

Find Max

A

max = first array index
fixed loop
if array index is more than max then
assign value to max
end if
next
display message

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

What can variables be declared as?

2

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

Local Variable Defintion

2

A
  • A variable declared in a sub program
  • Scope of variable is the sub program it is declared in
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Global Variable Defintion

A
  • A variable that is declared outwith a sub program
  • Scope of variable is the entire program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Implementation:

Parallel Arrays Definition

A

Arrays used in conjuction of each other so programmers can display information together

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

Implementation:

Records Definition

A

Programmer defined data types

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

Implementation:

How can multiple data types be held in one array?

A

By creating a record structure and declaring an array of records

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

Implementation:

Record Structure Code

A

Structure NAME
public NAME as DATATYPE
public NAME as DATATYPE
public NAME as DATATYPE
End Structure

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

Implementation:

Array of Records Code

A

Dim ARRAYNAME(num) as **NAME*

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

Implementation:

Module Programming Examples

3

A
  • Sub-Program
  • Procedure
  • Function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Implementation:

Sub-Program Definition

A

A block of code that can be called and accessed by the main program

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

Implementation:

Procedure Defintion

A

Sub-programs designed to perform a series of commands with values sometimes passed to/from another part of the program

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

Implementation:

Function Definition

A

Sub-programs designed to always return a single value to another part of the program

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

Implementation:

Formal & Actual Parameters

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

Implementation:

What is parameter passing?

A

When a local variable is passed from one sub program to another

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

Implementation:

What are the ways a parameter can be passed?

2

A
  • By reference
  • By value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Implementation:

By Reference Definition

A

The sub-program has direct access to the memory location holding the value. This means any changes to the value being held will be stored.

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

Implementation:

By Value Definition

A

The sub-program is given a temporary copy of the value being held in the variable. The value can be changed, but this will not be stored

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

Implementation:

How must arrays be parameter passed?

A

By Reference

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

Implementation:

What is a pre-defined function?

A

Code built into the software that does not need to be created by a programmer

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

Implementation:

What are the pre-defined functions?

4

A
  • Character to ASCII
  • ASCII to Character
  • Decimal to Integer
  • Find the Remainder
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Implementation (pre-defined functions):

Character to ASCII Code

A

Asc(“A”)
Returns 65

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

Implementation (pre-defined functions):

ASCII to Character Code

A

Chr(65)
Returns A

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

Implementation (pre-defined functions):

Decimal to Integer Code

A

CInt(3.14)
Returns 3

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

Implementation (pre-defined functions):

Find the Remainder Code

A

13 mod 2
Returns 1

31
Q

Implementation:

What are substring functions?

A

Functions that manipulate a whole string or extract a number of characters from a string, depending on the function

32
Q

What are the substring functions?

4

A
  • Left
  • Right
  • Mid
  • Uppercase
33
Q

Implementation (sub-string functions):

Left Code

A

Word = “Hello!”
MsgBox(Microsoft.VisualBasic.Left(VARIABLE, CHAR NUM))
Returns H

34
Q

Implementation (sub-string functions):

Right Code

A

Word = “Hello!”
MsgBox(Microsoft.VisualBasic.Right(VARIABLE, CHAR NUM))
Returns !

35
Q

Implementation (sub-string functions):

Mid Code

A

Word = “Hello!”
MsgBox(Microsoft.VisualBasic.Mid(VARIABLE, CHAR NUM))
Returns ll

36
Q

Implementation (sub-string functions):

Uppercase Code

A

Word = “Hello!”
MsgBox(UCase(word))
Returns HELLO!

37
Q

Implementation:

What is a sequential file used for?

A

To hold the data in a set sequence/order

38
Q

Implementation (sequential files):

What are the file operations?

5

A
  • Create
  • Open
  • Close
  • Read
  • Write
39
Q

Development Methodologies:

What are the development methodologies?

2

A
  • Iterative
  • Agile
40
Q

Development Methodologies:

What does the iterative process involve?

2

A
  • Programmers move from stage to stage in order, only revisiting stages where necessary and a problem is discovered
  • It is a very structured process and clients are only communicated with at the beginning and end of development
41
Q

What does the agile process involve?

2

A
  • Uses ‘sprints’ which are periods of planned analysis, design, implementation and testing of a particular aspect of software
  • It is a flexible process that is based on team work and daily communicated which is suited to small, short term projects rather than larger scale projects
42
Q

Development Methodologies:

Iterative Strengths

4

A
  • Rigid planning structure
  • Good for large teams
  • Helps to plan and track large software projects
  • Clear agreement on outcomes at start of project
43
Q

Development Methodologies:

Iterative Weaknesses

4

A
  • Very rigid approach does not deal well with mid-project changes
  • Can over-complicate simple projects
  • Unidentified issues at the analysis stage can be time-consuming and costly to gix
  • Little involvement of client after analysis
44
Q

Development Methodologies:

Agile Strengths

4

A
  • Copes well with little cumulative changes as the project progresses
  • Good for small scale projects like most apps
  • Ongoing involvement of client allows changes to be agreed quickly
  • Changes cause less delay or can be tackled in the next version
45
Q

Development Methodologies:

Agile Weaknesses

4

A
  • Works best with small teams
  • Needs close version control and tracking of changes
  • Can be difficult to determine the full scope of the project in the early stages
  • Usually no legally binding agreement at the start
46
Q

Testing:

Reasons for Testing

3

A
  • Identify errors
  • Show that all functional requirements have been met
  • Ensure efficient and maintainable code
47
Q

Testing:

Test Data Types

A
  • Normal
  • Extreme
  • Exceptional
48
Q

Testing:

Error Types Causing Program to Crash

2

A
  • Syntax
  • Execution / Run-Time
49
Q

Testing:

Error Type Causing Unexpected Result

A

Logic

50
Q

Testing:

Syntax Error Examples

2

A
  • Spelling mistakes
  • Mistake in the programming language rules
51
Q

Testing:

Execution Error Examples

4

A
  • Dividing by 0
  • Using an array index value that doesn’t exist
  • Writing to a file that doesn’t exist
  • Trying to read/write beyond the end of a file
52
Q

Testing:

Logic Error Examples

3

A
  • Using the wrong variable
  • Using the wrong logic operator (and/or/not)
  • Using the wrong conditional logic ( < > )
53
Q

Testing:

What is a dry run?

2

A
  • When a programmer works through the program on paper following the code line by line to pick up logic errors
  • Often used with trace table
54
Q

Testing:

What is a trace table?

A

Consists of the variables used in a specific programmer and allows the developer to track the values being stored at different points throughout the program

55
Q

Testing:

What is a breakpoint?

2

A
  • A user-defined point in the program where the code will stop executing, and the value of variables can be inspected to ensure they are correct
  • Often used with trace tables
56
Q

Testing:

What is a watchpoint?

2

A
  • A point placed on a specific variable to track any changes in value, program will stop when the value of the variable changes
  • Used with breakpoints to look at the value of only specific variables when a breakpoint is triggered
57
Q

Design:

What is top down, stepwise refinement?

2

A
  • Any main steps from the design are known as the top down design
  • These main steps are usually broken down further into step by step instructions known as stepwise refinements, which helps the programmer break down the program into manageable modules
58
Q

Design:

What are the benefits of a modular solution?

3

A
  • Different programmers can implement different parts of the design
  • Each part of the design can be tested seperately
  • Design shows the main process clearly
59
Q

Design:

What does a data flow do?

A

Shows the information that will flow in and out of sub-programs

60
Q

Design:

What are the design techniques?

3

A
  • Psuedocode
  • Structure Diagram
  • Wireframe
61
Q

Design:

Pseudocode Usage

A
62
Q

Design:

Structure Diagram Usage

A
63
Q

Design:

Wireframe Usage

A
64
Q

Evaluation:

What criteria is evaluated in a program?

5

A
  • Fitness for purpose
  • Efficient use of coding constructs
  • Usability
  • Maintainability
  • Robustness
65
Q

Evaluation:

Fitness for purpose

A
66
Q

Evaluation:

Efficient use of coding constructs

A
67
Q

Evaluation:

Usability

A
68
Q

Evaluation:

Maintainability

A
69
Q

Evaluation:

Robustness

A
70
Q

Analysis:

What is the role of a systems analyst?

2

A
  • Meeting with the client and discussing their specific needs
  • Creating a detailed project proposal
71
Q

Analysis:

What is the software specification?

A

Defined extent of the software and a legal contract between the client and the developers

72
Q

Analysis:

What is the role of developers in software specifications?

A

Legally obliged to create the specified software

73
Q

Analysis:

What is the role of a client in software specifications

A

Legally obliged to pay for the software

74
Q

Analysis:

What should analysis include?

4

A
  • Purpose: a general description of the purpose of the software
  • Scope: a list of deliverables that the project will hand over to the client / user
  • Boundaries: the limits that define what is in the project and what is not
  • Functional Requirements: features and functions that must be delivered by the systems in terms of inputs, processes and outputs