VCE Stuff > VCE Computing: Software Development

Methods vs Sequences vs Functions etc.

(1/2) > >>

Chowden:
After all this time I am still struggling to understand the difference between methods, functions, sequences, procedures,  control structures, recursion structures, repetition structures... you get the idea, would somebody be able to explain all of the above and other similar structures and the differences between them?

Chowden:
Please?

Chowden:
I'll fail.

Johno2110:
Remember these key points

Function - performs a task which is useful to the programmer, can be called from anywhere in a program, accepts parameters, returns data back into the function name. Example Sin(x), x is a variable and Sin is the function name, this sine function returns a value
Procedure - performs a task which is useful to the programmer, can be called from anywhere in a program, accepts parameters. The difference though is a procedure doesn't return a value
Methods - used a object orientated programming like Objective - C. A method is called on a event, such as when a user presses a button.

Selection Structure - a condition is being tested such as if 1 > 2
Repetition Structure - a number of tasks performed until a condition is met. Example while i > 5

Just a few there, though if you need any else they are in the Software Development Textbook

vic1215:
Just adding to Johno2110's post...

Methods are simply commands that will interact with an object and alter its behaviour (eg. setting btnQuit.Enabled to true would be a method). They are called directly through code (i.e programmer calls it).

Events on the other hand, are things that happen to an object (eg. a button is pressed). They are triggered by a user action or by objects. Events can end up running a method.

Navigation

[0] Message Index

[#] Next page

Go to full version