2.1.3 Thinking Procedurally Flashcards
1
Q
What is Procedural Thinking
A
- Procedural thinking is the process of thinking through a problem and developing a sequence of steps that can be used to reach the solution
- A programmer can use a procedural programming language to create a seqence of instructions to be followed by the comp.
2
Q
A procedural language carries out steps in an order. The order in which these steps are carried out in is defined by what 3 constructs
A
- Sequence:
- Dictates that steps will be carried out in the order they are given.
- Selection:
- Allows the programmer to choose to execute 1 instruction based on a condition that arises during the execution of preveious instructions.
- Iteration:
- Allows the programmer to repeat the same instruction a certain number of times or if a condition is met.
3
Q
What is Identifying the components of a solution
A
- Identifying the main components of a problem is a key step towards solving it.
- The process involves thinking through the problem. What needs to be achieved?, What actions would any solution need to carry out?
- The 2nd step in identifying the components of the problem is to break down the description into individual sentences. (Different stages of the problem) Then break down further
4
Q
What is Identifying the components of a solution to a problem
A
- Means identifying which steps need to be followed in order to reach a solution.
- The best way to identify these steps is by thinking through a possible solution and writing the actions that need to be carried out in order to achieve.
- For each major component of the problem. Make a list of key steps for each.
- This process is repeated for each part of the problem and will give a complete list of all components and solutions for each
5
Q
What is determining the order of the steps needed to solve the problem
A
- Next stage is to determine order in which steps are taken, In particular how to move between the different components.
- Best way to achieve this is to produce a flowchart of each component and the steps for solution.
- Final stage is to combine these separate flowcharts together to form a complete solution. Some can be joined/others merged togetehr.
6
Q
What are sub-procedures
A
- A sub-procedure is a sequence of steps grouped together and given its own name.
- These sub-procedures can then be called (using their name) from the main procedure whenever functionality offered is needed.
7
Q
What are the advantages of using sub-procedures
A
- Once it is decided what sub-procedures are needed, each procedure can be worked on by a different programmer. Solved faster
- Sub-procedures can be coded by programmers who are experienced in areas. Can be written in different languages before being compiled
- Reduce Repetition and the size of the final program. Sub-procedures can be called from anywhere else in the program.
- Makes it easy to debug and maintain a program. Easy to find which sub-procedure has mistake
- Procedure is easy to follow less likely for mistakes.
8
Q
How do you identify the sub-procedures necessary to solve a problem
A
- Look for sequences of steps that are repeated or are very similar at different points in the flowchart.
9
Q
What are the different steps of thinking procedurally and procedural thinking
A
- Identifying the components of a problem
- Identifying components of a solution to the problem (bullet point list)
- To determine order of steps needed to solve the problem (flowchart)
How to identify the sub-procedures necessary