Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Control Structures

AM4R

Posted 23 May 2006 - 07:40 PM

What are they basically?!

Im stuck on Q16 c on 2004? I dont think we did anything like that in school?!

st-and Paul

Posted 23 May 2006 - 08:16 PM

You did do it at school, its probably that they didnt tell you what they were. Control Structures are structures that allow the programmer to control the order of execution in a program. They are sequence of instructions, iteration over a set of instructions, conditional execution (if statements and anything which given a condition will determine whether a certain sequence of code is executed). Dont confuse it with stacks, queues etc or any other kind of data structure.

John

Posted 23 May 2006 - 09:30 PM

Stacks are dealt with at AH level so they shouldnt know about them anyway.

Control structures are algorithms which control the order of execution within a programme. (As pgm9 said)

These algorithms are what gives programmes and video games dynamic paths dependant on an event or choice made or caused by the user.

Examples of such algorithms would be, IF Statements, Conditional Loop, Unconditional Loops, Case Statements, or Logic Statements(used within the formers).

An example for using such statements would be:

IF Statements; What should happen if user chooses Player 1 or Player 2?

Conditional Loop; Something is to be repeated untill a certain event or condition is met

Unconditional Loop; Something should be repeated x amount of times.

Case Statements; When A meets B, this should happen, Or meets C, this should happen, Or meets D, this Should happen, etc

Logic Statements; When A OR B = x, y happens, A AND B = x, y happens, A NOT B = x, y happens.

Hope that helps.

AM4R

Posted 24 May 2006 - 10:28 AM

yup thanks smile.gif

  • You cannot start a new topic
  • You cannot reply to this topic