topic 2.1

Cards (23)

  • Decomposition
    Breaking down a complex problem or system into smaller, more manageable parts
  • Abstraction
    The process of moving from specific details to a more general model or representation
  • Algorithms provide the precise instructions needed to solve a problem. All computer programs are algorithms.
  • An algorithm is a step-by-step procedure for solving a problem or carrying out a task
  • Once an algorithm has been written, it can be reused with slight changes for solving similar problems which is much quicker than starting from scratch each time
  • Abstraction is the process of moving from specific details to a more general model or representation
  • One feature of seating that could be abstracted is colour
  • Other features the programmer could include when creating a general model for a seat
    • Number of legs
    • Inside or outside use
    • Capacity
  • Other features could be construction materials, the number of wheels, design elements (stripes, detail, width, height)
  • Decomposing problems before trying to solve them allows the problem to be broken down into smaller, more manageable parts
  • Subprograms allow complex programs to be broken down into smaller parts that are easier to code and debug
  • Using subprograms allows a team of programmers to work together on a project at the same time, as different programmers can write and debug different subprograms
  • Pre-existing subprograms and libraries can be used to perform common tasks, so programmers don't have to write and debug all the code themselves
  • Flowcharts use standard symbols to represent the different parts of an algorithm, such as processes, decisions, and inputs/outputs
  • Sequence ensures that commands are executed in the correct order, and is represented in flowcharts by the flow of most symbols
  • Selection allows the program to choose between two or more possible courses of action based on a condition
  • Repetition is needed when a written description of the algorithm includes words such as 'while', 'until', 'go back to', 'a number of times', or has a set number of repeats
  • Condition-controlled repetition is implemented using a 'while' statement in Python, and count-controlled repetition can be implemented using a 'while' or 'for' (range) statement
  • Iteration is the repeated execution of a set of instructions or a loop
  • Variable
    A named storage location that can hold a value that can change during the execution of a program
  • Identifier
    A name used to identify a variable, constant, function, or other entity in a program
  • Assignments are used to give a variable a value, e.g. SET index TO 5 or name = "your name"
  • The value assigned to a variable can be output, e.g. OUTPUT name or print(name)