What is a parameter
An item of data that is passed through a subroutine.
Explain the term procedural programming language.
High-level language that Gives a series of instructions in a (logical) order
Explain parameter passing.
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 .
Describe the use of local variables.
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
What is variable?
A named reference to a memory location where data is stored.
When are global variables are usually defined in a program?
Global variables are (usually) defined
at the start of a program
What will happen to local variables with the same name as global variable?
Local variables with the same name as
global variables will overwrite the values in the global variable.
Explain the advantages of writing an application using a modular approach.(6 Points)
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
Benefits of IDE
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
What is benefit of using a library?(2 Marks)
1.Pretested
2.Saves time
2 Benefit of encapsulation?
Reduces the chance of errors.
Data cant be changed accidently.
Tell me structure of class?
class video
private name
private views
private starrating
public procedure new(newname)
name = NewName
views = 0
starrating = 3
end procedure end class