¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

2.2 Programming Basics

Gabriel Gozo Computing GCSE Inglés

Contenido del mapa

2.2 Programming Basics

  1. Data Types

    • Integer
      • int
      • Whole Numbers
    • Boolean
      • bool
      • Can only take two values such as TRUE or FALSE
    • Character
      • char
      • Single letter, number or symbol
    • String
      • string
      • Used to represent text, a collection of characters
    • Casting
      • Conversion between data types
      • int("1)
      • float(1)
      • bool(1)
      • str(True)
    • Real(float)
      • Decimal numbers
      • real
  2. Basic Operators

    • + is Addition
    • - is Subtraction
    • Multiplication is *
    • Division is /
    • Exponentiation is ^
    • Quotient is DIV
    • Remainder (Modulus) is MOD or %
    • Comparison operators
      • == is equal to
        • <> or !+ is not equal to
          • < is less than
            • > is greater than
              • <= is less than or equal to
                • >= is greater than or equal to
  3. Constants and Variables

    • Constants are assigned to a data value at a designated time that cannot change.
    • Variables can be changed, unlike constants
  4. Strings

    • Strings are written inside quotation marks
      • x.upper will change all characters in string x to UPPER CASE
      • x.lower changes all characters in string x to LOWERCASE
      • x.length will return the number of characters in string x
      • x[i] will extract the character in position i from string x
      • x.subString(a,b) will extract a string starting at position a with length b from string x
  5. Program Flow

    • IF statements
      • Checks if condition is true or false.
      • Nested IF statements
        • Allows you to check more conditions once you've established that the previous condition is true
        • Made by putting one IF statement inside another
    • IF-ELSEIF statements can also be used to check multiple conditions, however, nested IF statements can only check more conditions if the previous condition is false
  6. SWITCH-CASE statements

    • Used to check if a variable has specific values
      • Used when you want a program to perfom different actions for different values of the same variable
      • Can only check value of one variable
  7. FOR Loops

    • Will repeat the code inside them a fixed no. of times
    • The no. of times that the code is repeated depends on initial value, end value and step count
  8. DO UNTIL LOOPS

    • Controlled by condition at the end of the loop
    • Continue until condition is true
    • Infinite loop is condition is never true
  9. WHILE LOOPS

    • Controlled by condition st start of loop
    • Continues while condition is true
    • Never runs if code is initially false
  10. DO WHILE LOOPS

    • Controlled by condition at end of loop
    • Continues while condition is true
    • Always runs code inside at least once
    • Infinite loop when condition is always true
  11. Booleean operators

    • AND will only return true if two things are True
    • OR will only return true if one of the things are true
    • NOT will only return true if there is one thing that is a LIE
  12. Arrays

    • A data structure used to store a collection of data all under one name
    • Useful for storing related data
  13. FILE HANDLING

    • To open a file, you must open it and assign it to a variable
      • Program will start reading or writing from the beginning
        • When finished reading/writing, close it use close() or the file can remain locked and prevent others from editing it
    • Reading/Writing
      • writeLine() will write lines of text to a file and overwrite already existing text
      • readLine() will allow you read lines of text from a file
      • endOfFile() will allow you to signify when a program should stop reading a file.
  14. Storing data

    • Record will store a collection of data values
      • Each item is called a FIELD
      • Each field gets a name and a data type
      • Fixed in length, so extra fields can't be added when created
  15. Searching data

    • SELECT is followed by the names of the fields you want to find
      • FROM is followed by the name of the table that you want to search
        • WHERE is used to specify condition that a record must satisfy before being returned
          • ORDER BY sorts records into ascending or descending order
  16. SUB PROGRAMS

    • Procedures are sets of instructions stored under one name
      • Functions always return a value
      • Parameters are sued to pass values into a sub program
        • Arguments are the actual values that the parameters take when the sub program is being called
          • SCOPE(tells you which parts of the program the variable can be used in)
            • Local variables can only be used within the structure
              • Scope only extends to sub program they are declared in
            • Global variables can be used any time after declaration

Información

Descripción
GCSE Computing Mapa Mental sobre 2.2 Programming Basics, creado por Gabriel Gozo el 06/06/2019.
Creado por
Gabriel Gozo
Visitas
1
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?