Computaitional Thinking 2.1 Flashcards
What is abstraction?
Abstraction is the process of removing unnecessary detail to create a representation of reality.
What is prefetching?
Technique where Instructions are fetched based on algorithms, which predict what instructions are likely to soon be used, predicts what data will be needed next and loads data into cache before it is needed.
State two advantages of using abstraction.
- Saves time and resources
- Removes unnecessary complexity.
What is the purpose of thinking ahead?
To make programs easy and intuitive for users to use.
What is a computer system
Any system in which data can be inputted, processed, and outputted.
Define input
Any data that is entered or received by a computer
State three types of inputs
Keyboard, mouse, touch screen, microphones
Define output
The results are passed back once the input has been processed.
State three types of outputs
Monitor, printer, speaker, projector
What are preconditions?
Requirements that must be met before a program can be executed.
State one example of a precondition.
- Queues - check that the queue is not full before adding another item
- root function - check that the number is not negative
Where can a precondition be defined?
Before the code is executed e.g before a loop
Define caching
Storing instructions or values in cache memory after they have been used, as they may be used again.
State an advantage of caching
- Cache memory is faster than main memory
- It stores data for temporary use
How is caching used in storing web pages?
Web pages that are often visited are cached, so the next time a web page is visited it will be loaded without delay
Give a limitation of caching
- Effectiveness of algorithm in managing the cache
- Size of the cache
- expensive
Give an advantage of using reusable program components
- Since you do not have to create it from scratch, it will save time money, and resources.
- More reliable than coding from the start since it has already been tested
- Removes repeated code(saves memory, increases performance of program)
Give two examples of reusable components
- Classes
- Queues
- Stacks
- Subroutine
What is the purpose of decomposition?
Makes problems easier to solve
By breaking down problems into smaller chunks, makes it easier to split workload according to individual skill sets
What shape is used to show a decision in a flowchart?
A diamond
What is concurrent thinking?
When you complete more than once task at the same time
What is concurrent processing?
When a task takes a small part of the processors time to give the impression that multiple things are being run at once
What is a drawback to concurrent processing?
- Concurrent processing can take longer to complete when large numbers of users or tasks are involved as processes cannot be completed at once.
- Not all tasks are suited to being broken up and performed concurrently.
- reduces program throughput
What is parallel processing?
Systems where multiple instructions can
be completed at any given time, doesn’t
require multiple cores, it can use pipelining instead.
.
Prefetching
What is the first part of thinking procedurally?
Taking the problem defined by the user and breaking it down into parts
.
Stepwise refinement
decomposition
By continusly breaking down a problem into subproblems until each subproblem can be represented as a single task
What are the benefits of a decomposition?
- Problems can be solved by different people
- Tasks can be tested seperatly
What type of problems are decomposition suited to?
large, complex problems
What is the second stage of thinking procedurally in software development?
Identifying components in a solution
What must a software developer do before designing a subrotuine to solve a problem
To see if it is possible for an already existing subroutine to be used
In a flowchart how many options stem from a decision?
2 different options, yes or no
Does the result of a decision change the flow of the program
Yes, The program will follow a different route depending on the decision of the user