GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Program Control Structures

a St George GCSE Unit 4 GCSE Englisch

Program Control Structures

Inhalt der Mindmap

Program Control Structures

  1. Selection

    • The sequence of instructions can be changes based on the value of variables within that program. Statements are selected based on a value through the use of IF statements and boolean operators
      • IF- Statement
        • Whnen a condition in an IF-statement evaluates to true, the statements follwing it are executed, otherwise the statements following ELSE are executed.
  2. Iteration

    • "Repetition"; when a section of code is carried out more than once.
      • Unconditional repetition
        • There is a start value and a stop value for the loop. The loop is incremented by 1 (default) each time.
        • Example: a program to output all the multiples of three between 3 and 99 will repeat the loop 97 times.
      • Conditional repetition
        • The loop will run until a particular condition is true or false..
        • Example: a program to ensure that a user enteres a integer value between 1 and 50. A boolean variable can be used to control the loop.
    • Loops and conditions are used to repeat the sections of code.
      • FOR Loop: for(initialise, condition, increment)
        • for(int i = 0, i < totalTime, i++)
        • initialise: variable is set to the starting value of the loop once only
        • condition: this is evaluated during each execution of the loop
        • increment: updates the loop control variable
      • WHILE Loop: While (Boolean Condition) do
        • A boolean condition has to be met (true or false) for the loop to execute, and will run until the boolean condition is the opposite - true or false
        • A loop can also test the condition at the end of the loop. This means the code will be executed at least once.
  3. Sequence

    • This denotes the order in which instructions are carried out. Each statement is carried out one after the other.
      • Incorrect Example:
        • This example is trying to output the average before the numbers have been entered and running this would result in a logic error.
      • Correct Example:

Bilder und Dateien der Mindmap

  • Program Control Structures
  • Program Control Structures
  • Program Control Structures
  • Program Control Structures
  • Program Control Structures
  • Program Control Structures

Informationen

Beschreibung
GCSE GCSE Unit 4 Mindmap am Program Control Structures, erstellt von a St George am 07/05/2022.
Erstellt von
a St George
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck