2.1 Elements of computational thinking Flashcards
What is abstraction?
removing information that is too complex or irrelevant to the system’s purpose (unnecessary detail)
Why is abstraction needed? (3)
-enables for efficient software design as programmers can focus on core features instead of unnecessary details
-reduces time spent on a project
-saves memory space
What is an example of abstraction?
TCP/IP model
-abstraction of how networks function
-separated into four simple layers
-each layer deals with a different part of the communication process
-doesn’t need to know how other layers function
What are the different ways projects can be abstracted?
-representational
-data
-layered
-generalisation
-procedural
Explain representational abstraction
-removing unnecessary details to represent a problem using only the key features
-must analyse what is relevant to a scenario and simplify a problem based on this
Explain data abstraction
-details about how data is being stored are hidden
-programmers can use data structures without knowing how they are implemented
Explain layered abstraction. Give an example of this
-large, complex problems are split into layers of abstraction
-each layer has a different role, with the highest layers being closest to the user
-these are usually responsible for providing a user interface
-the lowest levels perform tasks such as interacting with machine components
example of this is the TCP/IP model
Explain abstraction by generalisation
-grouping together similarities within a problem to identify what kind of problem
-allows problems to be categorised as being of a particular type
-a common solution can be used to solve these problems
Explain procedural abstraction
-allows programmers to utilise functions without knowing how they are implemented
-used in decomposition and manipulating data structures
-models what a subroutine does without considering how, as once a subroutine has
been written, it can be reused as a black-box
What should we think about when needing to devise an abstract model for scenarios? (4)
-what is the problem that needs to be solved by the model?
-how will the model be used?
-who will the model be used by?
-which parts of the problem are relevant based on the target audience and purpose
of the model?
Why is thinking ahead useful?
makes development easy and programs can be built to be intuitive
What are inputs?
data required to solve the problem (data entered into the system by the user)
What are outputs?
results passed back to the user
What are some ways of thinking ahead? Why are these useful? (3)
-creating preconditions (requirements which must be met before a program can be executed)
reduces length and complexity of programs
saves time spent on debugging and maintenance
-creating reusable program components (using libraries or subroutines)
saves time
increases development efficiency
reliable
-caching (storing instructions/data in cache memory after they’ve been used, as they could be used again)
saves time instead of going to secondary storage
frees up bandwidth
less time to fetch
What do we mean by thinking procedurally?
breaking down a complex problem then thinking logically and sequentially to find a solution