2.2.1 Programming Techniques Flashcards

(12 cards)

1
Q

What is a parameter

A

An item of data that is passed through a subroutine.

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

Explain the term procedural programming language.

A

High-level language that Gives a series of instructions in a (logical) order

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

Explain parameter passing.

A

1.Parameters passed by value or by
reference
2.IF By value, local copy of data is used then
discarded so value of (original) data is unchanged
3.If By reference, location of data is used so changes may be made to value of data .

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

Describe the use of local variables.

A

1.Defined with one module and accessible in only that module.
2.Can be used as parameter
3.Data is lost at the end of the module

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

What is variable?

A

A named reference to a memory location where data is stored.

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

When are global variables are usually defined in a program?

A

Global variables are (usually) defined
at the start of a program

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

What will happen to local variables with the same name as global variable?

A

Local variables with the same name as
global variables will overwrite the values in the global variable.

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

Explain the advantages of writing an application using a modular approach.(6 Points)

A

1.Code can be reused in the project/
future projects
2.Work is easier to divide between a
team
3.Saves time as work takes place in
parallel
4.each team member can work on their
area of expertise.
6.Easier to test/ debug/ read

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

Benefits of IDE

A

Auto-complete -Can view identifiers / avoid spelling
mistakes
Syntax highlighting -Can identify features quickly / use to check code is correct
Stepping-Run one line at a time and check result
Breakpoints- Stop the code at a set point to check
value of variable(s)
Error diagnostics-Locate and report errors

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

What is benefit of using a library?(2 Marks)

A

1.Pretested
2.Saves time

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

2 Benefit of encapsulation?

A

Reduces the chance of errors.
Data cant be changed accidently.

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

Tell me structure of class?

A

class video
private name
private views
private starrating

       public procedure new(newname)
            name = NewName
            views = 0
            starrating = 3
       end procedure   end class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly