Login

Welcome, Guest. Please login or register.

September 06, 2025, 10:40:38 am

Author Topic: Methods vs Sequences vs Functions etc.  (Read 2390 times)  Share 

0 Members and 1 Guest are viewing this topic.

Chowden

  • Victorian
  • Adventurer
  • *
  • Posts: 24
  • Respect: +1
  • School: Christian College
Methods vs Sequences vs Functions etc.
« on: November 06, 2014, 02:46:08 pm »
0
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

  • Victorian
  • Adventurer
  • *
  • Posts: 24
  • Respect: +1
  • School: Christian College
Re: Methods vs Sequences vs Functions etc.
« Reply #1 on: November 08, 2014, 01:18:58 pm »
0
Please?

Chowden

  • Victorian
  • Adventurer
  • *
  • Posts: 24
  • Respect: +1
  • School: Christian College
Re: Methods vs Sequences vs Functions etc.
« Reply #2 on: November 08, 2014, 01:19:25 pm »
0
I'll fail.

Johno2110

  • Victorian
  • Adventurer
  • *
  • Posts: 5
  • Respect: 0
  • School: De La Salle
Re: Methods vs Sequences vs Functions etc.
« Reply #3 on: November 08, 2014, 05:31:46 pm »
0
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

  • Victorian
  • Adventurer
  • *
  • Posts: 10
  • Respect: 0
  • School: Melbourne High School
  • School Grad Year: 2015
Re: Methods vs Sequences vs Functions etc.
« Reply #4 on: November 08, 2014, 08:51:16 pm »
0
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.

Chowden

  • Victorian
  • Adventurer
  • *
  • Posts: 24
  • Respect: +1
  • School: Christian College
Re: Methods vs Sequences vs Functions etc.
« Reply #5 on: November 09, 2014, 01:57:50 pm »
0
Ok, thanks guys! I unfortunately don't have my textbook with me at the moment asking here was all I could think of.

Just another question, Is a sequence just another word for one of the above sturctures?
« Last Edit: November 09, 2014, 01:59:41 pm by Chowden »

vic1215

  • Victorian
  • Adventurer
  • *
  • Posts: 10
  • Respect: 0
  • School: Melbourne High School
  • School Grad Year: 2015
Re: Methods vs Sequences vs Functions etc.
« Reply #6 on: November 09, 2014, 02:27:59 pm »
0
A sequence is another type of control structure. It is simply instructions in a program that are executed in a step by step fashion.

There are three types of control structures in SD.

The other two are:

Repetition (or iteration) - Repeatedly performs a series of steps for a fixed number of times or until a condition has been met.
Selection - executes certain sections of code based on conditional statements (eg. the use of IF/ELSE is a type of a selection control structure).


Chowden

  • Victorian
  • Adventurer
  • *
  • Posts: 24
  • Respect: +1
  • School: Christian College
Re: Methods vs Sequences vs Functions etc.
« Reply #7 on: November 13, 2014, 04:06:13 pm »
0
A sequence is another type of control structure. It is simply instructions in a program that are executed in a step by step fashion.

There are three types of control structures in SD.

The other two are:

Repetition (or iteration) - Repeatedly performs a series of steps for a fixed number of times or until a condition has been met.
Selection - executes certain sections of code based on conditional statements (eg. the use of IF/ELSE is a type of a selection control structure).
Thanks for that!