comp sci aqa

Cards (60)

  • Algorithm
    A sequence of steps that can be followed to complete a task
  • Pseudocode
    • A fairly relaxed version of program code that should be understood by any programmer
    • AQA has its own version of pseudocode
  • Flowchart symbols

    • Start/end
    • Process box
    • Input/output
    • Choice (for if statements and loops)
  • Abstraction
    The process of removing unnecessary detail from a problem, simplifying it
  • Decomposition
    Breaking a problem down into many sub-problems that each represent a specific task
  • Trace table

    A table that shows how values change when an algorithm is carried out, going through every line of code
  • Trace tables do not correspond one-to-one with lines of code, there may be multiple lines of code in one row of the table
  • Linear search

    A searching algorithm that compares each item in the list one by one until the target item is found or not found
  • Binary search

    A more efficient searching algorithm that compares the middle item in the list to the target, and discards half the list that cannot contain the target
  • Binary search

    • Requires the list to be sorted
    • More time-efficient than linear search as the list grows larger
  • Bubble sort

    A sorting algorithm that goes through the list in 'passes', swapping pairs of items to put the list in order
  • Merge sort

    A more efficient sorting algorithm that works by repeatedly dividing the list in half and merging the sorted sub-lists
  • Merge sort

    • More time-efficient than bubble sort, especially as the list grows larger
    • Uses more memory overall due to the sub-lists
  • Data type

    Determines how data is stored on a computer and the operations it can do
  • Arithmetic operators

    Division (/, div), modulus (mod)
  • Relational and Boolean operators

    Used in conditions for if statements and loops (=, >, <, and, or)
  • String handling operations

    Substring, concatenation
  • Variable
    An identifier that holds a value that can be changed
  • Constant
    An identifier that holds a value that cannot be changed after it is set
  • Constants
    • Help with readability
    • Make updating values easier in the future
    • Reduce risk of accidental changes
  • Input/output
    How to get user input and display output
  • Sequence
    Two or more lines of code that run one by one
  • Selection (if statements)
    Deviate the path of execution depending on a condition
  • Iteration (loops)

    Repeat a block of code multiple times
  • If statements are always checked, whereas else-if statements are only checked if previous conditions were false</b>
  • Common mistakes with if statements include adding conditions to else blocks and forgetting about else-if
  • If it's always checked if you've got an if part this will always be checked no matter if you have several back to back
  • If price is greater than 30 and if price is greater than or equal to 20

    Both premium and standard would be outputted because both are checked
  • Else ifs or e-lifts sit below an if statement

    The else if is only checked if previous conditions were false
  • You can have several else ifs if you want to, just make sure they come after the if
  • Mistakes in exams are people adding conditions to else's and also forgetting about else if
  • Definite iteration

    A set number of times the loop will repeat
  • Indefinite iteration

    The loop will repeat until a condition is broken or met
  • For loop

    1. Repeats a set number of times
    2. Counter variable starts at a set number and goes to another set number
  • While loop

    1. Repeats until a condition is broken
    2. Asks user for password and keeps asking until they get it right
  • Repeat until loop

    1. Repeats until a condition is met
    2. Condition comes after the loop, so it always runs at least once
  • Array
    An organised collection of items of the same data type
  • Indexing
    Specifying a particular item within an array, starting from 0
  • Iterating through an array

    Using a for loop, starting at 0 and going to size of array - 1
  • 2D array

    An array of arrays