Thinking Ahead

Cards (30)

  • What does designing a solution entail in the context of computational problems?

    It involves thinking ahead about the different components of a problem and how they will be handled.
  • Why is it important for developers to consider difficulties that may arise when software is used?
    To design strategies that make programs easy and intuitive to use.
  • What are the two main components of all computational problems?
    Inputs and outputs.
  • What are inputs in the context of computational problems?
    Any data required to solve the problem, entered into the system by the user.
  • What are outputs in computational problems?
    Results that are passed back once the inputs have been processed and the problem solved.
  • What must designers decide on to present a solution effectively?
    A suitable data type, structure, and method.
  • In the context of an ATM program, what input is required for a balance check?
    Card details and PIN entered via keypad.
  • What output is displayed if a deposit is selected in an ATM program?
    Total amount entered on screen.
  • What happens when a withdrawal is selected in an ATM program?
    The correct amount of cash is dispensed.
  • What devices are required to capture input data for an ATM?
    A touch screen, magnetic stripe card reader, and keypad.
  • What devices are used to output data from an ATM?
    A monitor, cash dispenser, printer, and speakers.
  • What is the typical first step for designers when creating a solution?
    Considering what outputs are required based on the user’s requirements.
  • What are preconditions in programming?

    Requirements that must be met before a program can be executed.
  • How can preconditions be specified in programming?

    They can be tested within the code or included in the documentation.
  • What does the function pop() do in a stack?
    It removes the last item added to the stack.
  • Why is it important to check that a stack is not empty before using pop()?
    To avoid errors that could cause the program to crash.
  • What is the responsibility of the user regarding preconditions specified in documentation?
    To ensure inputs meet the requirements specified.
  • How do preconditions contribute to program efficiency?
    They reduce the length and complexity of the program and save time needed for debugging.
  • What are reusable program components?
    Commonly used functions packaged into libraries for reuse.
  • What is the benefit of using reusable components in software development?
    They are more reliable as they have already been tested.
  • What is the process of decomposing a problem in software design?
    Breaking it down into smaller, simpler tasks.
  • What is caching in computing?
    The process of storing instructions or values in cache memory after they have been used.
  • What is the purpose of caching?
    To save time retrieving instructions from secondary storage again.
  • What is prefetching in the context of caching?
    Algorithms predict which instructions are likely to be used soon and load them into cache beforehand.
  • What is a limitation of prefetching?
    The accuracy of the algorithms used to predict instructions.
  • How does cache size affect caching performance?
    Larger caches take longer to search, limiting how much data can be stored effectively.
  • What is the general challenge of implementing caching effectively?
    It can be difficult to implement but can significantly improve performance if done correctly.
  • What are the key components of inputs and outputs in a computational problem?
    • Inputs: Data required to solve the problem, entered by the user.
    • Outputs: Results passed back after processing the inputs.
  • What are the steps involved in designing a solution for a computational problem?
    1. Identify required outputs based on user requirements.
    2. Determine necessary inputs.
    3. Process inputs to achieve outputs.
  • What are the advantages and disadvantages of using reusable components in software development?
    Advantages:
    • More reliable due to prior testing.
    • Saves time, money, and resources.
    • Can be reused in future projects.

    Disadvantages:
    • Compatibility issues may arise.
    • Modifications may be costly and time-consuming.