module 1

Cards (18)

  • Computer
    A device with a processor (CPU) which can execute basic instructions, memory to store data and instructions that are in use, storage for ongoing retention of data and programs, input and output devices to communicate/interact with users
  • Programming
    Programming is problem solving, programs are written in order to fulfil a need / solve a problem, a programming language is the tool used to create a solution, by writing a program using a programming language, you can make a computer do something useful
  • Machine Code
    A computer's processor can only understand a set of very basic instructions, such as simple arithmetic operations, this is known as machine code, and it is not feasible to write large or complex programs directly in machine code
  • Assembly Language
    Assembly language replaces the numeric instruction codes of machine code with short descriptive words, e.g. "add", each instruction corresponds to a machine code instruction, so it is still very low level and unfeasible for large, complex programs
  • High-Level Languages
    High-level languages are the programming languages you hear about / use: Python, C, Java, PHP, C++, C#, JavaScript, Swift, Go, etc, instructions in high-level languages are referred to as "statements", and usually translate to multiple machine code instructions, these languages are much easier for people to write code in, as well as reading and editing that code at a later stage, the code of a program written in a high-level language is known as the "source code" of the program, the computer's processor still only understands machine code; the source code must be translated into machine code in order to be run
  • Compilation
    The entirety of the source code is translated into machine code and an executable file of it is produced, this is a relatively slow process, however the resulting file runs quickly as it is not being translated on the spot, and the compiler can spend time to further optimise the resulting file, some compiled languages include C and C++
  • Interpretation
    An interpreter translates and executes each source code statement one at a time as the program is run, slower to run as it is "doing it live", but fewer steps involved, some interpreted languages include Python, PHP and JavaScript
  • Syntax
    The "words" that the language recognises, the "phrasing" required to specify values, the ways of arranging these into valid "sentences", any errors in your syntax will prevent the code from running
  • Input/Output
    Some statements obtain input from users, or display output to users
  • Selection
    Some statements can choose between different sections of code to run based upon the result of a conditional check
  • Iteration
    Some statements can repeatedly run a section of code while a certain condition is met, or a certain number of times
  • Functions
    Some statements define sections of code that can be used at other points in the program where it is needed, or call upon other pre-defined code
  • Programs typically involve using selection, iteration and functions to manipulate and process input, in order to transform it into useful output
  • Some programs (typically ones with graphical interfaces) are "event-driven" – they wait for the user to do something (e.g. click a button) and run statements in response
  • Program Design
    Writing syntactically correct code is difficult and can distract you from the problem that you are trying to solve, hence it is useful to be able to plan out the logic and structure of your solution prior to commencing the actual programming, pseudocode and flowcharts are two ways of representing the steps and statements that a program will implement, pseudocode and flowcharts are valuable design tools that experienced programmers use, they are designed to be read by people, not parsed by a computer, they follow the conventions of programming, e.g. selection & iteration, they often omit minor, insignificant and assumed statements
  • Pseudocode
    Pseudocode does not have defined standards, rules or syntax that need to be adhered to, focus upon internal consistency, not external consistency, there is no single "correct" way to write pseudocode
  • Flowcharts
    Flowcharts are a more visual approach to program design, using symbols with specific meanings associated with them, they are "stricter" than pseudocode, but this is a necessity in order to produce flowcharts that anyone can read, the goal of these design tools is to illustrate and communicate your design in a clear way
  • Flowchart Symbols

    • Flow Line (indicates direction and connection between things)
    • Processing (indicates a basic operation, step or action)
    • Terminator (indicates start or end of a flowchart)
    • Input/Output (indicates input or output)
    • Decision (indicates a choice with true/false outcomes)
    • Predefined Process/Function (indicates a sub-process – may be detailed in separate flowchart)