GoConqr has a new look! Let us know what you think.

Mind map

Basic components of programming

L O Digital Technologies Year 10 English

Map content

Basic components of programming

  1. Computer programs are written to process DATA

    • Data stored with different DATA STRUCTURES
      • COMPLEX
        • ARRAY/LIST
        • OBJECT
          • OOP
            • class
              • starts with class keyword, followed by class name and colon eg class LivingThings():
            • methods and attributes
            • properties
            • instance
            • encapsulation
      • SIMPLE
        • VARIABLE
          • global
            • at start
          • local
            • for specific function
          • $number = 0; $name = 'John Smith';
          • superglobals
            • always available regardless of scope
    • DATA TYPE
  2. Algorithm CONTROL STRUCTURES

    • SEQUENCE
      • step by step
        • statement; statement; statement;
    • SELECTION
      • true/false
      • if-then-else
        • if (condition) { statement; statement; }
          • Statement executed only when TRUE
        • if (condition) { statement; statement; } else { statement; statement; }
        • if (condition) { statement; statement; } else if (condition) { statement; statement; } else { statement; statement
    • ITERATION
      • counted loop
        • for
          • for ($variable=0; $variable < somenumber; $variable++) { statement; statement; }
          • for (initialization expression; test condition; update expression) { // code to be executed }
      • pretested loop
        • while
          • while (condition) { statement; statement; }
          • while (set condition true){code;}
        • certain condition met at start of loop
      • post tested loop
        • used for looping until condition met at end of loop
        • do-while
      • foreach loop
        • used in arrays
    • CONDITION
      • logical expression
      • logical operators AND OR NOT
  3. Arithmetic

    • Basic maths calculations + - * /
  4. FUNCTIONALITY

    • METHODS
      • see OOP
    • FUNCTIONS
      • function function_name($somevariable){ executable code; }
      • to use (call) a function use just its name followed by semicolon eg displayName()
      • Consists of three parts: function name, set of () to hold incoming variables, set of {} to enclose code for function
    • Forms
      • <formaction = "where it goes file.php" method "post">
      • input element example: <input name="something" type ="input type" value "something">
        • input name used for $_POST variable
        • input value passed when submit button pressed
      • form element example: <form name="something" method ="post" action "someaction.php"></form>
  5. Control Flow of program

    • Event listeners like mouse click
      • events trigger functions to run
  6. naming conventions

    • variables
      • starts with $, lowercase (snake case) with underscore between words
    • function
      • lowercase with underscore between words
      • do things so name must use verb
      • include keyword function as part of the name
        • name must reflect what function does
    • inside a class
      • properties (variable inside a class or object
        • camelCase (starts with lowercase
      • methods (similar to function but in class or object)
        • same as properties
    • constants
      • UPPERCASE with underscore between
    • classes
      • Titlecase (starts with uppercase), singular
    • files
      • lowercase with underscore
    • class files
      • match class name
  7. common issues

    • indentation must be correct - use three spaces not tab
    • lines with conditionals (if,else etc) must be terminated with semi-colons
    • capitals are important
    • parentheses and braces must match closing ones
    • quotes around strings

Information

Description
Year 10 Digital Technologies Mind Map on Basic components of programming, created by L O on 25/08/2019.
Created by
L O
Views
0
History
  • Created by L O · Aug 25, 2019
  • Copied by L O · Aug 25, 2019
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?