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

Mindmap

programming basics

Jonathan Green Englisch

Inhalt der Mindmap

programming basics

  1. data types

    • programming languages have 5 main data types, Integer, Real, Boolean, Character and string
    • each data type is allocated a different amount of memory
      • integer 2 or 4 bytes
      • Real 4 or 8 bytes
      • boolean, 1 bit is nneded but 1 byte is used
      • character 1 byte
      • string 1 byte for every character in the string
    • programming languages can be weakly or strongly typed. Weakly typed languages will try to convert data types to avoid errors, however this can lead to more unpredictable results. Strongly typed languages wont try to convert data types so will produce more errors but more predictable results
    • casting is used to change the data type
      • Languages have functions that let you manually covert between data types
        • int(1) converts the string 1 into integer 1
        • float(1) converts the integer 1 to the float 1.0
        • bool(1) converts integer 1 to the boolean value true
        • str(true) converts boolean value "true" into string true
    • Using the correct data types for different variables
      • initial of first name: N
      • surname: Chapman
      • age(in whole years):27
      • height (in meters): 1.64
      • male or female: male
  2. operators

    • functions and operators
      • addition +
      • subtraction -
      • multiplication *
      • division /
      • expontation ** or ^
      • Quotient DIV
      • remainder MOD or %
    • comparison operator
      • == is equal to
      • <> or != is not equal to
      • < less than
      • > greater than
      • <= lass than equal to
      • > more than equal to
  3. constants and variables

    • data values can be constants or variables
      • data values can be stored in constants or variables
      • the name of a constant or variable is linked to the memory location
      • a constant is assigned a data value at design time that cant be changed
      • variables on the other hand change value which makes them far more useful than the constants
  4. strings

    • strings are written inside quotation marks
      • string1 = "My favourite colour is"
        • string2 = "purple"
          • new_string = string1 + " " + string2
    • programs let you manipulate strings in a variety of different ways
      • x.upper: changes all the characters in the string to uppercase
      • x.lower changes all the characters in the string to lowercase
      • x.length: returns the number of characters in string x
      • x[i] extracts the character position i from string x
      • x.subString(a,b): extracts a string from a starting position a with length b from string x
  5. program flow

  6. defensive design

    • helps to ensure programs function properly
    • makes sure inpus cant be exploited
    • programmers try to protect their programs through defensive design
    • when programs are functioning correctly they should never break and never produce errors

Informationen

Beschreibung
Mindmap am programming basics, erstellt von Jonathan Green am 06/06/2019.
Erstellt von
Jonathan Green
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck