Computer science 2.1

Cards (56)

  • Abstraction
    The process of removing unnecessary details and including only the relevant details.Part of computational thinking and focusses on what is important in problem solving.
  • Decomposition
    Breaking a complex problem down into smaller more manageable parts.As dealing with many different stages of a problem at once is more difficult than breaking a complex problem down into smaller more manageable parts and solving each problem at a time
  • Algorithmic thinking
    A way of getting to a solution by identifying the individual steps needed.By creating a set of rules an algorithm that is followed precisely ,leads to an answer.Algorithmic thinking allows solution to be automated.Eg learn algorithms for multiplication if algorithm is followed then you can get the answer.
  • How to do Algorithmic thinking
    Break problem down
    Thinking about what data is important and not
    Thinking about relevant data structures
    Tackle each part of the program step by step
  • What to think about when tackling a problem
    inputs, processes and outputs
  • Inputs
    Anything that needs to be supplied to the program so it can meet its goals.
    Often input by user
    Appropriate variable name and data type for the input
  • Processes
    Consider what calculations need to be performed while the program is running.
    Does data need to change formats or data types
  • Outputs
    Consider what your program needs to output
    Consider form output needs to take
    Consider appropriate variable name and data type for any output
  • Structure diagrams
    A method of designing a solution to a problem.
    Structure diagrams illustrate problem decomposition.Can be used for developers to understand a problem to code and to share with users during system analysis.Produced using step-wise refinement.Break problem down using decomposition.The lowest level nodes should achieve a single task.They can then be coded as a single module or sub-program
  • Pseudocode
    An alternative, text-based way of representing the sequences of steps in an algorithm. Pseudocode can be thought of as a simplified form of programming code.
  • What does the prefix pseudo mean?
    False or not genuine
  • oval symbol flowchart
    start/stop
  • parallelogram symbol flowchart
    input/output
  • rectangle symbol flowchart
    process
  • rectangle with lines flowchart
    sub routine
  • diamond symbol flowchart
    decision
  • Flowchart
    Symbols
  • coment
    //
  • Input
    Variable=input(prompt)
  • variables
    Assignment
    Constants
    Global variables
  • Assignment
    x=3
  • constants
    const vat =20
  • global variables
    global userid=123
  • Casting
    str(3) returns 3
    int("3") returns 3
    float("3.14")returns 3.14
    real("4.52")returns 4.52
    bool("True")returnsTRUE
  • Outputs
    Print("hello")
    prints(variable)
  • for loop
    for i = 0 to 7
    ........
    next i
  • while loop
    while answer!=x
    ........
    endwhile
  • do while loop
    do
    ...................
    until answer==x
  • Comments
    AND
    OR
    NOT
  • OCR EXAM LANGUAGE
  • OCR EXAM LANGUAGE P2
  • If-Then-Else
    If x==6 then
    ......
    else if...then
    .........
    else
    ..........
    endif
  • case select or switch
    Switch x:
    case "a":
    ......
    case "b":
    .......
    default:
    .......
    Endswitch
  • string length
    variable.length
  • substrings
    variable.substring(start ,num)
  • uppercase
    variable.upper
  • lowercase
    variable.lower
  • ASCII conversation

    ASC(character)
    CHR(ascii number)
  • procedure
    Procedure name (...)
    .....
    Endprocedure
  • calling a procedure
    procedure(parameters)