unit 10 Flashcards
define computational thinking
the ability to think logically about a problem and apply techniques to solve it
what is abstraction?
the process of removing unnecessary details of a problem to focus on the important features to implement in a solution
what are some real life examples of abstraction?
a car simulator, a representation of a building, a map of a train route
what are preconditions?
conditions that must be true for an algorithm to complete successfully without errors or crashing
what are some examples of preconditions?
parameter list must not be empty
data needs to be of the same type
what is the process for defining preconditions?
Name
Inputs
Outputs
Preconditions
what are the advantages of specifying preconditions?
if provided in documentation, then the developer is aware of what checks are required
allows the subroutine to be reusable and put in a library to be called whenever
what is caching?
cache is tiny storage on a processor used to temporarily store frequently used data
what is web caching?
HTML pages and images most recently looked at are stored for faster access and saving bandwidth by not requiring them to be redownloaded each time
what is the need for reusable components?
commonly used subroutines are bundled into libraries
already tested
save time with new projects
what is decomposition?
the process of breaking down into smaller sub problems until each module can be tackled individually
what is a top down design?
breaking down problem into smaller ones until each one is unable to be broken down further
what is the goal of a top down design?
to structure a program into small manageable tasks
what is the advantage of decomposition?
each subroutine is simpler to test and maintain (unit testing)
each subroutine is self-contained and well documented it is easier to find errors in code
can reuse the subroutines
what is unit testing?
checking the smallest building blocks of your code to ensure they work perfectly
what is a hierarchy chart?
a diagram used to show problem decomposition
they show how module and subroutines relate to each other like a tree structure
what is sequence?
one statement after another
what is selection?
decision making
what is iteration?
loops
what are the purpose of programming techniques?
to aid the readability, understanding and maintainability of code
what do decisions affect?
decisions are Boolean conditions in selection or iteration which affect the flow of control in a program
what is the difference between branching and iteration?
branching involves directing the flow of control of a program dependent on a Boolean condition
iteration involves repeating a sequence of instructions based on a stopping condition
what is concurrent computing?
allows multiple processes to run on a single processor by giving each process a fraction of time and control over the processor before swapping processes
what is parallel computing?
where multiple processes are run at the same time over multiple processor cores to enable faster execution