2.2.1 Programming techniques

Cards (91)

  • What is an algorithm?
    Step-by-step procedure
  • Match the programming technique with its description:
    Sequence ↔️ Executes instructions in a linear order
    Selection ↔️ Makes decisions based on conditions
    Iteration ↔️ Repeats a set of instructions
  • What is the purpose of data structures?
    Store and manage data
  • The `do-while` loop executes its block of code at least once, regardless of the condition.
    True
  • Iterative control structures allow programmers to write complex and flexible programs.

    True
  • Programming techniques refer to the different methods and approaches used to write computer programs
  • Pseudocode is a high-level, human-readable description of an algorithm
  • Arrays store elements of the same data type in an ordered manner.

    True
  • Match the OOP concept with its description:
    Classes ↔️ Blueprints for creating objects
    Objects ↔️ Instances of classes
  • Modularity enhances overall code quality by making programs more flexible and scalable.
    True
  • Why does OOP promote modularity in programs?
    Encapsulates data and behaviors
  • What is an algorithm defined as in programming?
    A step-by-step procedure
  • An algorithm must be unambiguous, meaning its instructions leave no room for interpretation
  • A stack uses a LIFO principle, which stands for Last-In-First-Out
  • What does an if-else statement do in programming?
    Executes different blocks based on conditions
  • Functions promote modularity by breaking down code into manageable pieces
  • What is a key advantage of modularity in programming?
    Improved maintainability
  • Modularity increases code reusability
  • Objects are instances of classes in OOP.

    True
  • OOP promotes modularity by encapsulating data and behaviors.

    True
  • What factors influence the choice between manual and automatic memory management?
    Application requirements
  • The Factory pattern allows subclasses to decide which class to instantiate
  • Unit testing involves testing individual components
  • An algorithm must be unambiguous, meaning its instructions leave no room for interpretation
  • What is a key characteristic of an algorithm regarding its instructions?
    Unambiguous
  • Match the data structure with its description:
    Arrays ↔️ Ordered collection of elements
    Stacks ↔️ Last-in-first-out (LIFO)
    Queues ↔️ First-in-first-out (FIFO)
    Trees ↔️ Hierarchical data structure
  • What is the purpose of the `for` loop?
    Repeat code a specific number of times
  • Conditional control structures, such as 'if-else' and 'switch', are used to make decisions
  • Match the programming technique with its description:
    Sequence ↔️ Executes instructions in order
    Selection ↔️ Makes decisions based on conditions
    Iteration ↔️ Repeats a set of instructions
  • Flowcharts provide a visual representation of an algorithm's steps.
    True
  • Functions are self-contained blocks of code that perform a specific task
  • OOP organizes software around data and their behaviors
  • What is the primary focus of Object-Oriented Programming (OOP)?
    Data and behaviors
  • In programming techniques, a sequence executes instructions in a linear order
  • One characteristic of an algorithm is that it must be finite
  • An effective algorithm must produce the correct output for all valid inputs.

    True
  • Which data structure is used to represent hierarchical relationships in file systems?
    Trees
  • A while loop continues executing as long as a condition is true
  • Modularity involves dividing a program into smaller, independent modules or functions.
    True
  • Modularity enhances overall code quality