Unit 2.1 - Elements of Computational Thinking Flashcards
What is abstraction?
Hiding unnecessary detail and showing details that are important in context in order to reduce complexity.
A representation of reality, using symbols to show real-life features or irrelevant features left out.
Why is it necessary to use abstraction?
- Irrelevant details to the problem would require unnecessary programming/design effort (and could detract from the main program.
- Reduces complexity
- Highlight the important details to improve the clarity of what is being conveyed.
What is procedural abstraction?
The process of breaking down a complex problem into smaller, more manageable (and essential) steps.
What is functional abstraction?
The details of a function’s implementation are suppressed and show only the output provided by the function.
What is data abstraction?
The reduction of a particular body of data to a simplified representation of data that separates the interface from the implementation
What is problem abstraction?
The process of taking away or removing certain characteristics of a complex problem to reduce it to its most essential components.
This helps to simplify or break down the problem to make it easier to resolve.
What is an input?
The signals or data, received by the system, that it needs to process.
What is an output?
The result of an activity carried out after data has been processed which the system produces.
What is a precondition?
A condition that already exists and should be taken into consideration before devising a solution to a problem (or a program).
They often impose sensible restrictions - and sometimes very frustrating and essential ones.
What types of blocks of code can be reused multiple times?
- Procedures
- Subroutines
- Functions
- Methods
What is caching?
Frequently used instructions/data retrieved and placed from main memory to cache in case they are needed again before the program using them ends.
What is prefetching?
Data being requested from main memory (RAM) by the processor before it is required.
How are flowcharts an abstraction?
They are an abstraction of program code.
How are assignments an abstraction?
An assignment is a statement to set a value to a variable.
Variables are labels to where the value is stored, but the actual value is stored in binary.
Why is thinking ahead essential when designing a program?
- Maximise code efficiency
- Minimise errors
What are the first tasks to do when designing a program?
- Decide the output the system should produce.
- Decide what the inputs are.
- Consider about any preconditions.
- If any parts of the code can be reused.
What are 3 types of input devices?
- Microphone
- Mouse
- Keyboard
- Camera
- Phone/computer
What are 3 types of output devices?
- Speakers
- Screen
- Printer
- Monitor
- GPS
- Headphones
What is considered a computer?
A device that takes in user input, processes the data and outputs it into an understandable format for humans.
Why are preconditions important?
- They impose sensible restrictions (sometimes very essential ones)
- They will have implications on certain factors (time, money and overall result produced etc)
What are the benefits of reusing code?
- Shortens development time
- Saves systems resources
- Lowers development costs
- Reduces redundant code
What is redundant code?
Source code that has no logical affect to the output (unnecessary code ).
What is code-reuse?
- Reusing existing sections of code that have been tested by a previous developer
- Reusable components can- and should be - reused during the development of newer programs
What are 4 ways that code can be reused?
- Modular programming
- Software library (library routines)
- Using entire components across program suites
- External reuse
What is modular programming?
A concept where developers separate program functions into independent pieces, and each piece contains all of the necessary parts to execute one aspect of functionality.
What is a subroutine?
A block of code that performs a specific task and can be reused multiple times by calling it and supplying it with data it needs.
What are three types of subroutines?
- Procedures
- Functions
- Methods
What is a software library?
A suite full of pre-written and pre-tested code available for other programmers to develop software programs.
What is a library routine?
A small block of debugged code that can be used in programs to perform specific tasks (usually functions).
What are the benefits of library routines?
- Already compiled = tested and error free
- Shortens development time and reduces costs
- Can be reused multiple times
- May have been written in different source language
- Allows use of other programmers’ expertise
- More standardised approach to coding
- May require fewer developers to work on a project