Chapter 4

Descripción

Programming Techniques
Karl Taylor
Mapa Mental por Karl Taylor, actualizado hace más de 1 año
Karl Taylor
Creado por Karl Taylor hace alrededor de 8 años
62
4

Resumen del Recurso

Chapter 4
  1. Basic Program Constructs
    1. Sequence
      1. The execution of statements one after another. This usually forms the bulk of the code in any program
      2. Selection
        1. Selection is where the flow through a program is interrupted and control is passed to another point in the program. The decision is based on a Boolean expression.
        2. Iteration
          1. Controlled by the state of a Boolean expression, a section of code is repeated.
        3. Recursion
          1. When a procedure or function calls itself
            1. This can be another way to produce iteration
            2. Global & Local Variables
              1. Global Variables
                1. Declared or initisialised outside any sub programs; functions or procedures
                  1. Accessible to code written anywhere in the program
                    1. Can be accidentally changed
                    2. Local Variables
                      1. Declared inside a subprogram
                        1. Only accessible within the sub program it is declared in
                    3. Branch
                      1. BRA (Branch always)
                        1. This is a jump instruction that is always executed
                        2. BRP (Branch if positive)
                          1. This is a jump instruction that occurs when the value in the accumulator is positive
                        3. Subprograms
                          1. Functions
                            1. An algorithm that takes an input and produces an output for each input
                              1. Defining a function requirments
                                1. A Function Name
                                  1. Any parameters needed by the function; that is, the data that must be fed into the function
                                    1. The output - usually one output but there can be zero or many outputs
                                      1. The processing code itself
                                      2. Returns a value
                                        1. Must be written as part of an equation
                                        2. Procedures
                                          1. Dosen't return a value
                                            1. Does not need to be written as part of an equation
                                            2. Exact definitions of functions and procedures are slightly diffirent depending on which language you use
                                              1. Parameter Passing
                                                1. By reference (By Ref)
                                                  1. The function is given the actual memory address of where the data for the variable is stored
                                                    1. Any changes to the variable in the function are permenant
                                                  2. By value (By Val)
                                                    1. A copy of the original data is passed the function and any changes made are lost as soon as the function is no longer in use
                                                2. The IDE (Integrated development environment)
                                                  1. A text editor used for writing source code
                                                    1. Facilities for automating the build
                                                      1. A debugger
                                                        1. Features to help with code writing, such as pretty printing and code completion
                                                        Mostrar resumen completo Ocultar resumen completo

                                                        Similar

                                                        Computing in the Modern World
                                                        JTaylor
                                                        Computers in the Military
                                                        JTaylor
                                                        N5 Computing Science
                                                        Mr. McNeice
                                                        JOOSE2 Design Patterns
                                                        Isaac Jordan
                                                        Chapter 4: Pensum C
                                                        Anita Thomer
                                                        Sensation & Perception
                                                        Jessica Auger
                                                        Chapter 4 Vocabulary Words (SHSAT)
                                                        irenepapers
                                                        Chapter 2
                                                        Karl Taylor
                                                        Chapter 1
                                                        Karl Taylor
                                                        Chapter 4: Pensum B
                                                        Anita Thomer
                                                        Cells at work - metabolism
                                                        sheydn302452