Computational thinking (unit 10) (Finished) Flashcards
(10.1) What is computational thinking?
The ability to think logically about a problem and apply techniques for solving it
(10.1) What is abstraction?
a way of separating the logical and physical aspects of a problem
(10.1) How can abstraction be applied to situations?
by separating the relevant/irrelevant parts of a situation and focusing on the relevant ones
(10.1) How can a real world object help be solved?
Through abstraction, making a model of the problem and discarding all the unnecessary parts
(10.1) What is modeling?
A way of testing a scenario virtually before doing it in real life
(10.2) What is the simplest form a computer program can be put in?
Input (information relevant to the program)
Computations
Output (solution to the problem)
(10.2) What else do we need to specify besides inputs and outputs for programs to work?
Preconditions, such as length of list
(10.2) What are some advantages of specifying preconditions?
Making program components reusable
Cutting out unnecessary checks
Making programs easier to debug and maintain
(10.2) What is the main advantage of creating reusable program components?
Well-defined and documented functions and procedures may be used in many different programs
They can be added to a library and imported whenever needed
Overall save time and be efficient in using code that already works
(10.2) Can any modules be reusable?
No, they should adhere to certain standards, such as
Inputs, outputs and preconditions should be documented
Variable identifiers should conform to a standard convention
All variables must be local to the module
Documentation should be in a standard format, explaining what the module does, who it was written by, date it was written
Annotations of code should be included where necessary
All code to be peer reviewed. (Although this is time consuming.)
(10.2) What is caching?
Caching is the temporary storage of data and instructions
The last few instructions of a program to be executed, the result of an earlier computation, or data used may be stored in memory so they can be very quickly retrieved
(10.2) What are the disadvantages of caching?
Slower performance if the resource isn’t found in the cache
Being given a stale copy of a resource when an up-to-date copy is needed
(10.3) What is decomposition?
breaking a problem into a number of sub-problems, so that each sub-problem accomplishes an identifiable task
The sub-problems may themselves be further subdivided
(10.3) What is structured programming?
Structured programming aims to improve the clarity and quality of a program
method of writing a computer program which uses:
Modularization
Structured code
Recursion
(10.3) What is a top-down design model?
a system design approach where design starts from the system as a whole.
continuously divided into smaller parts until it is composed of minute details
(10.3) What kind of design technique does structured programming use?
A top-down design technique
(10.3) How can a hierarchy chart be used to present program structure?
By the decomposed program having each part of it be represented by a node in the chart
(10.3) In what order is a hierarchy chart executed?
Left to right, always starting at the lowest level component
(10.3) What are the benefits of modularization?
Programs are more easily and quickly written
Programs take less time to test and debug
Programs are easier to maintain
(10.3) When should the program be divided into smaller, individual modules?
in larger programs, as in shorter programs it may not be worth it due to the already small size
(10.3) What is a subprogram/module/procedure/function?
a small section of code within a larger piece of code which has a specific task
(10.3) What is modularity?
Splitting a larger program into smaller, more manageable parts
makes it easier to manage
programming in a modular way