🥴CS Paper 2 🥴

Subdecks (2)

Cards (138)

  • Iterative Testing
    1. Testing should be ongoing throughout the development process
    2. You should code an aspect of your program and test it before moving on
  • Final Testing
    At the end of the development, when the program is complete, the program should be tested again (as a whole) against the requirements of the customer to ensure their needs have been met
  • Integrated Development Environment (IDE)

    A software package that provides the tools for a computer programmer to develop a software
  • IDE
    • Allows programmers to write their high level code
    • Allows programmers to test their code
    • Allows programmers to translate their code
  • To generate a random number between 1 and 10:
    use: random.randint(1,10)
  • Parameter :
    • A value or variable passed into a subroutine
  • Benefits of using subroutines:
    • Avoids duplicating the code
    • The code can be reused throughout the program
    • Improves the readability and maintainability of program
    • Breaks down complex problems into manageable chunks
  • Local & Global Variables
    • A local variable is a variable that is inside a subroutine and can only be accessed from within that subroutine
    • A global variable is a variable that is outside of a subroutine and can be accessed from anywhere in the program
  • Input Sanitation:
    • Removes unwanted data from the inputs
    • Prevents SQL injections
  • Computers only understand binary because they have transistors which only have two values that are 0 and 1
    • Compiler
    • Translates code as a whole
    • Produces an executable file
    • Does not need to be compiled again
    • Interpreter
    • Translates code line by line
    • Will be interpreted / translated every time it is run.
  • Maintainability
    • Comments
    • To allow programmers to understand the purpose of each line
    • Naming variables sensibly
    • To allow the programmers to understand the purpose of each variable
    • Reduces confusion and errors if less similar variables
    • Indentation
    • Good code structure
    • Subroutines
    • They can be called upon and reused throughout program
    • Reduces errors
  • Defensive designs
    • Verification
    • Validation
    • Authentication
    • Input Sanitisation
    • Maintainable code
  • An algorithm is a set of instructions that can be followed to solve a problem or complete a task.
  • Computational Thinking
    • Abstraction
    • Decomposition
    • Algorithmic Thinking
  • Decomposition:
    Breaking down large and complex problems into smaller manageable pieces
  • Abstraction:
    The process of removing unnecessary details from a problem and leaving important parts to simplify it.
  • Algorithmic thinking:
    A logical way of thinking of how a problem is solved and the method to solve the problem
  • FLOWCHART:
    Line - Shows the flow of data
  • FLOWCHART:
    Rectangle - General instructions , processes and calculations
  • FLOWCHART:
    Terminals - Indicate the start or end or a program
  • FLOWCHART:
    Diamond - A decision being made
  • FLOWCHART:
    Sub programs - Literally sub programs / sub routines
  • Linear Search:
    1. Look at the first item
    2. If it doesn't match the item you're looking for, then move on to the next item
    3. Repeat until it matches the item you're looking for
  • Binary Searches only work on data that is ordered
  • BINARY SEARCH Advantages:
    • More Efficient. Fewer searches to find items
    • Good for larger data sets
    • Often much quicker
  • BINARY SEARCH cons:
    • Data must be in order for it to work
  • Advantages of High Level Language:
    • Easier to write / understand / modify
    • Easier to maintain and find errors
    • ...because code is similar to English language
    • Will work with different computers
  • Disadvantages of High Level Languages:
    • Must be translated into machine code before running
    • You cannot directly manipulate the CPU
    • ...therefore less efficient and slower 🐢⏰
  • Advantages of Machine Code:
    • Can directly manipulate the CPU
    • Can be executed directly without any translation
    • ... therefore more faster and efficient 🐆
    • Easily understood by computer
  • Disadvantages of Machine Code:
    • Difficult to read , understand , modify
    • Only works for one type of machine or processor
    • Hard to find errors
  • Advantages of Insertion sort:
    • Easily coded
    • Good with small lists
    • Quick at checking if sorted
    • Little memory used because it uses original list
  • Disadvantages of Insertion sort:
    • Not efficient for large data sets
    • ...because it would require more comparisons
  • Advantages of Bubble sort:
    • Efficient way of checking if the list in order
    • Uses less memory because it uses the original list.
  • Disadvantages of a Bubble sort:
    • Not efficient with large lists
    • ...because it would have to do a lot of comparisons
    • Quite Slow
  • Advantages or Merge sort:
    • More efficient and faster than other algorithms at sorting large lists
  • Disadvantages of Merge sort:
    • Slower for small lists
    • Even if the list is ordered, it still does the process of merging
    • Uses more memory in order to create separate lists
  • Integrated Development Environment (IDE):
    • Error Diagnostic
    • Displays any errors and locates them. Suggests ways to fix them
    • Translator
    • Translates high level code into machine code so that it can be executed
    • Code Editor
    • Allows code to be written and edited
    • Run - Time Environment
    • Allows you to run the program