Programming techniques Flashcards

1
Q

If loop

A

If the condition is true then one or two statements are execute
if condition is not true then statements under loop are skipped and then control is passed to the next statement

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

Switch/end switch

A

can be used to compare multiple expressions

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

Nested statement

A

Second statement is only checked if the first statement is true

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

While/ end while loop

A

The condition is tested upon entry to the loop

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

Do/until loop

A

The statements are executed before the condition is evaluated

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

for/next loop

A

This is used to repeat a block of instructions a specified number of times

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

What is modular programming?

A

This means breaking down a major task into smaller sub tasks

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

Advantages of modular programming?

A

Programs can become easier to program and manage (once broken)
each module can be individually tested so it is easier to find errors
Modules can be re-used several times in a program
Much easier to de-bug and maintain

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

Define a subroutine

A

A subroutine is a named block of code which performs a specific task within a program

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

Define global variables

A

Global variables are variables used in the main program and these can be used anywhere in the program

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

Define local variables

A

Local variables can be used within the subroutine and they only exist during the execution of the subroutine.They can not be accessed outside the subroutine and changing the value will have no effect.

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

Define a Function

A
A subroutine with a named identifier called as a part of an expression.Returns multiple value or none
Function name(parameter)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define a Procedure

A

A subroutine with a named identifier can be called from anywhere in the program.when called code is executed and control passed back to the program where the procedure is called from
Returns a single value

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

Define Iteration

A

Code that is executed a given number of times or until a condition is met.Can cause infinite loop if condition is not met

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

Define Variables

A

Variables are identifier(names) given to memory locations whose contents will change during the course of the program

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

Define a constant

A

Value that never changes while a program is being run

17
Q

One advantage of a constant

A

In a long complex program there is no chance that a programmer will accidentally change its value

18
Q

Define Sequence

A

A sequence is just two or more statements following one after the other

19
Q

Parameter passing by value

A

If a parameter is passed by value its actual value is passed to the subroutine,where it is treated as a local variable

20
Q

Parameter passing by reference

A

If a parameter is passed by reference the address and not the value of the parameter is passed to the subroutine

21
Q

Black box testing

A

Black box testing is carried out independently of the code used in the program

22
Q

What does black box testing do?

A

Looks at program specification
Creates a set of test data
Covers input,output and program functions

23
Q

What is white box testing?

A

White box testing is a method of testing software that tests the internal structure if workings of an application

24
Q

What is alpha testing?

A

This is carried out by the software developer’s in-house team and by the user

25
Q

What can alpha testing show?

A

It can reveal errors or omissions in the definition of the systems requirements.
The user may discover that the system does not do exactly what they wanted (often used by off-the-shelf software)

26
Q

what is beta testing?

A

This is used when commercial software is being developed e.g. windows
The software is given to a number of potential users who agree to use the software and report any faults.
Users may try to do things the developers don’t anticipate

27
Q

What is the water fall model and when to use?

A
Each stage is completed and documented before the next is begun. The customer only see the end product when its finished,any changes mean the project has to start over
when to use:
requirements are clear and fixed
short project
no ambiguous requirements
28
Q

Adv and Dis of waterfall model

A

Adv:
simple to use and understand
each stage is separate
makes project straightforward to manage
Dis:
not much user involvement after analysis stage
working software produced in last stages of cycle
to late to make changes have to start again

29
Q

What is the spiral model and when to use?

A

4 steps analysis,design ,implementation,evaluation
passes repeatedly through these steps.each loop generates a more refined prototype until requirements are met
When to use:
medium to high risk projects
requirements are complex
large projects with huge amount of time(maybe years)