6.2 Thinking Ahead (OCR A Level Computer Science) Flashcards

Exam code: H446

1/12

0Still learning

Know0

Cards in this collection (12)

  • Define decomposition.

    Decomposition is the process of breaking down a complex program into its component parts to make it more efficient and robust.

  • Why must a program's inputs and outputs be defined before implementing its processes?

    Defining a program's inputs and outputs before implementation is necessary to ensure the algorithm operates correctly and efficiently, as it allows for precise specification of what data is processed and what results are expected.

  • An input is any piece of data an algorithm requires to run, usually passed as a           to a subroutine.

    An input is any piece of data an algorithm requires to run, usually passed as a parameter to a subroutine.

  • True or False?

    If the inputs and outputs of an algorithm are not explicitly defined, it can lead to errors and unexpected problems later.

    True.

    Not defining inputs and outputs explicitly makes algorithm design harder and increases the risk of errors and problems when unexpected events occur.

  • Define precondition in computational thinking.

    A precondition is a condition that must be true before an algorithm or subroutine can execute successfully, preventing errors or crashes.

  • Why must a list be ordered before using the binary search algorithm?

    The binary search algorithm requires the list to be ordered so it can correctly divide and eliminate sections of the list; an unordered list will result in incorrect results or failure.

  • A subroutine may require that the         of an input list is greater than 0 as a precondition.

    A subroutine may require that the length of an input list is greater than 0 as a precondition.

  • True or False?

    Defining preconditions for a subroutine can help make it reusable in different programs.

    True.

    Specifying preconditions allows a subroutine to be reused safely, since required conditions are clear to any programmer using it.

  • Define cache as used in computational thinking.

    A cache is a tiny storage area on a processor that temporarily holds frequently used data and instructions to speed up program execution.

  • True or False?

    Caching is only used in computer processors and cannot be applied to web browsing.

    False.

    Caching can also be used in web browsers, where recently accessed HTML pages and images are stored for faster access and to save bandwidth.

  • Define library in programming.

    A library is a collection of reusable subroutines or functions that can be used in different programs to perform common tasks such as printing, casting, or generating random numbers.

  • Why is it beneficial for developers to use thoroughly tested and documented subroutines from libraries in their projects?

    Using thoroughly tested and documented subroutines from libraries saves time and reduces errors, as developers can rely on existing, reliable code instead of writing and debugging new code for common tasks.

Sign up to unlock flashcards

or