Topic 1

Cards (87)

  • What are the two main processes in programming mentioned?
    Decomposition and abstraction
  • What is abstraction in programming?
    • Removing unnecessary detail
    • Focusing on important points
  • What is the purpose of decomposition in problem-solving?
    To reduce the size of the problem
  • How do subprograms help in programming?
    They break down complex programs into smaller parts
  • What is one benefit of using subprograms in code?
    They make the logic of code clearer
  • How do subprograms aid in code maintenance?
    They can be modified without affecting the whole program
  • What is the process of removing unnecessary detail so that only the most important points remain?
    Decomposition
  • What is the purpose of using decomposition and abstraction?
    To reduce the size of the problem
  • What are the benefits of using subprograms?
    • Make code easier to design, code and debug by breaking down a complex program into smaller parts
    • Make the logic of code clearer by replacing blocks of code with meaningful named subprograms
    • Make code easier to maintain by allowing subprograms to be modified without affecting the rest of the program
    • Avoid unnecessary duplication of code by allowing subprograms to be reused
  • What are the main components of a flowchart?
    Start/stop symbol, process symbol, input/output symbol, arrows
  • What are the 4 options for the size variable in the selection algorithm?
    Large, Small, Medium, Medium
  • What are the 3 common types of loops used in algorithms?
    While, Until, As long as
  • What is the definition of iteration?
    • The process of looping through every item in a data structure
    • Repeating a set of instructions for every item in a data structure/list
  • What are some suitable variable names for storing results?
    result1, result2, result4, result5, total, theMean
  • What are the steps in the algorithm to search for a friend in an array?
    1. Get the first name and last name from the user
    2. Assume 'found' is false
    3. Point to the first row in the array of friends (index 0)
    4. Loop through the friends
    5. Check if 'found' is true, if so go to step 8
    6. Check if there are any more friends to look at, if not go to step 8
    7. Check if the friend's first and last name match, if so set 'found' to true and go to step 4, otherwise move to the next friend
    8. If 'found' is true, print "Found the friend", otherwise print "Friend is not in the array"
  • What is the difference between modulus and integer division?
    Modulus returns the remainder, integer division returns the quotient
  • What is the result of the logical expression "Met"?
    True
  • What are the two main outcomes of a linear search algorithm?
    Finding the target item, reaching the end of the list
  • What are the steps in the binary search algorithm?
    1. The median item is 27 but this is higher than the search item
    2. The sub-list to the left is used: 3, 5, 9, 14, 17, 21
    3. The median is 9 but this is too low, the sub-list 14, 17, 21 is used
    4. The median selected is 17 which is the search item
  • What is the purpose of the bubble sort algorithm?
    To sort a list of items
  • What is the result of the logical expression "P = A AND NOT B"?
    True
  • What is the purpose of the microprocessor hardware?
    To only operate on bits, with no concept of type or representation
  • How many bits are needed to represent 24 colors?
    5 bits
  • What are the strengths and weaknesses of digital sound recording?
    Strengths:
    • Entire analogue recording is represented
    • No loss of quality over time

    Weaknesses:
    • Limited by the sampling frequency
    • Limited by the number of bits used to encode each sample
  • How many bits are needed to store 24 colors?
    5 bits
  • What is the file size in gigabytes of a 4096 MB file?
    4 GB
  • What are the strengths and weaknesses of lossless data compression?
    Strengths:
    • Reduces file size for transmission
    • Allows original data to be reconstructed exactly

    Weaknesses:
    • Not as effective at reducing file size as lossy compression
  • What is the stored program concept?
    Program instructions and data are stored in main memory and transferred/fetched one at a time to the CPU, where they are decoded and executed
  • What are the main functions of the CPU?
    Read program instructions and data from memory, write results to memory
  • What are the steps in the fetch-decode-execute cycle?
    1. Instructions are fetched from memory into the CPU sequentially
    2. Instructions are decoded by the CPU
    3. Instructions are executed by the CPU, with arithmetic and logic operations performed by the ALU
  • What is the difference between volatile and non-volatile storage?
    Volatile storage requires power to retain data, non-volatile retains data without power
  • What are some advantages of secondary storage?
    • High capacity
    • Relatively cheap per unit of storage
    • Fast data access/retrieval
    • Can be kept off-site/away from the office
  • What is an example of an embedded system?
    A system that uses a sensor to monitor water temperature and control a heating element
  • How do operating systems manage processes?
    • Share out CPU time between processes so each gets a time slice
    • Prioritize processes so high priority ones get more CPU time
  • How do operating systems manage files?
    • Organize files in a hierarchical tree structure
    • Maintain records of the start location and sequence of file blocks
  • What type of utility software would be most useful for uploading a file?
    File compression software
  • Why is a quick fix solution to a software problem problematic?
    It may have unintended consequences in other areas of the program
  • Why are low-level programming languages preferred for embedded systems?
    They enable efficient use of the system's memory and hardware
  • What are the advantages and disadvantages of using an interpreter versus a compiler?
    Advantages of interpreter:
    • Provides immediate feedback
    • Allows testing and debugging as program is developed

    Advantages of compiler:
    • Optimizes code for efficient use of limited resources
  • Why is a WAN used instead of a LAN for a company with stores in different locations?
    A WAN covers a wider geographic area than a LAN