TOPIC 4

Cards (39)

  • Compound operations are combinations of fundamental operations used to achieve more complex tasks.
    EXAMPLES: LOOPS, CONDITIONS...
  • Fundamental operations are basic and indivisible operations that a computer can directly execute. These cannot be broken down into smaller actions
    EXAMPLES: ARITHMETIC OPERATIONS, AND/OR/NOT, ASSIGNMENT TO VARIABLES...
  • Assembly is a low-level programming language designed to simplify machine code so programmers don't have to manually count one and zeroes
    It makes machine code human-readable
  • Interpretation is one of the ways to convert from a high-level to a low-level language. The code is converted in executable binary code line by line. EXAMPLE: PYTHON
    • In interpretation, the translation is fast but the execution is slow.
    • Errors are easier to find as it indicates errors after each line.
  • Compilation is converted into executable binary in one go. It translates high-level language into machine code in one executable file.
    EXAMPLE: C
    • In compilation, the translation is slow but execution is fast
    • Errors are harder to find
    • It generates an binary code
    • May need to be re-compiled to use on a different operating system
  • There are high-level and low-level programming languages because humans need to use a high-level programming language, but the CPU requires machine code.
  • The CPU is the central processor unit in a computer
  • Low-level languages like Assembly or Machine Code are not human friendly, hard to follow and find errors
  • High-level languages like Java, Python, C... Are human friendly and easy to follow and find errors.
  • Gantt charts are charts in which a series of horizontal lines show the amount of work completed in certain planned periods.
    They use thinking procedurally, ahead and concurrently.
  • Thinking abstractly refers to getting rid of unnecessary details and solving problems focusing on the main points, generalizing.
    EXAMPLE: LONDON TUBE MAP (the unnecessary details are removed because they are not necessary for its purpose)
  • Thinking logically entails using rational thinking and deduction to make a decision in order to solve a problem. IF... THEN...
    EXAMPLE: Booleans (true or false)
  • Thinking ahead means planning in advance, It involves considering future consequences when taking action.
    EXAMPLES: Pre-conditions, exceptions...
  • Thinking concurrently means solving multiple problems at the same time, saving time. WHILE... WHILE...
    EXAMPLE: You can't build a roof without its walls or its walls without its foundation, so these tasks can't be done concurrently. However, you can lay down multiple foundations at once.
  • Thinking procedurally implies identifying a step-by-step approach to solve a problem, it evaluates whether the order in which activities are planned will result in the required outcome.
    EXAMPLES: Making a list to clean your room, solving puzzles, sub-procedures, debugging...
  • Parameters are variables that converts into a function when it is called
  • Trace tables is a tool used to trace the execution of an algorithm step by step. It shows how the variables change at each stage.
  • Trace tables helps check that your logic is correct and minimizes errors.
  • Trace tables are tables where the columns represents variables and their values and rows represents the lines of code
  • A variable is a container where you store a value that can be changed during an algorithm.
  • Sub-procedures are lines of code that you can reuse whenever they are needed. It only has to be written once and can be run multiple times. It allows a team of programmers work concurrently as it doesn't interfere with others work.
    They save time, minimizes errors and it is easier to organize, understand and test.
  • A flow chart is a visual representation and type of diagram made from boxes and arrows that shows an algorithm from start to end. They are very useful because they identify specific steps, simplifies complex information and communicates ideas faster.
  • Pre-conditions and post-conditions gives the user a sense of what to expect before and after running an algorithm
  • Pre-conditions define the conditions that must be true before the code executes. They avoid undefined behaviour. EXAMPLE: If you want to divide two numbers, state that the denominator cannot be 0.
  • The purpose of pre-conditions and post-conditions is to ensure that your code works correctly and efficiently.
  • Pseudocode is used by humans to describe algorithms. It uses English instead of programming languages. Pseudocode helps you plan out how you would like your code to look like without worrying about the details. This makes it easy to read and write.
  • Post-condition defines the condition that will be true when the procedure finishes running. EXAMPLE: The order of the array will be shown in ascending order.
  • An algorithm is a list of set instructions used to solve a problem or perform a task
  • Assembly is a low-level programming language designed to simplify machine code so programmers don't have to manually count 1 and 0's. It makes machine code human-readable.
  • Binary search has the objective of finding a position of a specific element in an array. It divides the array in half and compares the element with the middle one. In each step, you can eliminate half of the array where the element is not found in.
  • Binary search requires sorted array
  • Sequential search is used to find the position of a specific element in an array. It iterates through an array until the element is found or reaches the end
  • Sequential search doesn't need to be sorted.
  • Bubble sort has the objective of sorting an array in normally ascending order. It compares adjacent elements and swaps them if they are in the wrong order, until the whole array is sorted.
  • Bubble sort always sorts the maximum number first, so it is good when you need to know the maximum grade
  • Selection sort has the objective of sorting an array in normally ascending order. It finds the minimum number and switches it to the current position, then finds the remaining minimum and switches, and so on.
  • Selection sort always finds the minimum value first, so it is useful if you want to know who got the less time (won) a race.