Topic 4 Flashcards
List two criteria to use when assessing whether a solution is satisfactory.
- Speed
2. Readability
What are sub-procedures?
Sub-procedures are procedures that have no use on their own but are used in other procedures to contribute to solving a larger problem, which are known as methods in Java.
List 3 benefits of modular programming.
- Reusability
- Debugging
- Organisation (split up workload)
List two examples of decision making statements.
- if (else)
2. switch
Every decision making statement returns a…
boolean
What are the 3 parts of a solution?
- Input
- Processes/procedures
- Output
Why is pre-planning important?
E.g.
we need somewhere to store information about what to code, inputs, outputs etc.
What are the two tasks in a software development cycle that must be conducted concurrently?
Testing and development
What are gantt charts used for?
Managing the period of time in which a task will be in development
What are pre-conditions? E.g.?
Pre-conditions are things that need to be tested before executing a solution. It is necessary for some solutions because the functions of a solution may have to rely on these pre-conditions, e.g. connecting to a database requires internet connection
What are post-conditions? E.g.?
Post-conditions are things that must be tested in order to check that the solution has done what it’s supposed to have done, e.g. printing out the results and checking if it is reasonable.
When are exceptions thrown?
An exception occurs when the program expects something but the input does not match as expected.
List 3 advantages of implementing parts concurrently.
- Efficiency/time
- Organisation in a large group
- Some parts may depend on other parts
What is concurrent processing?
Essentially multitasking, a real life example of this is the building of a car, where the different parts are pre-built separately but concurrently.
What is a major strength of concurrent processing?
Speed
List two weaknesses of concurrent processing.
- Cannot be used when processes of constructing a solution must be linear (i.e. one function depends on the output of another)
- Difficult to code, debug and trace
What is an abstraction?
Abstraction in a solution to a problem in the design level, showing a concept of an object rather than the actual object.
Abstraction is used for hiding the unwanted data and giving relevant data and focuses on what the object does rather than how it does it.
What is the structure of a while loop in pseudocode?
loop while CONDITIONS
actions
end loop
What is the structure of a do while loop in pseudocode?
loop until CONDITIONS
actions
end loop
What are the two most common ways of using linear arrays?
Sorting and searching
List two types of sorting and explain how they work.
Bubble - goes through an array and compare two adjacent elements, swap the two elements if the order in which they’re in are not do not satisfy the results we’re looking for.
Selection - goes through an array at every element and looks for any value that is smaller/larger (depending on what ways we’re sorting), if there’s one value that is smaller/larger, swap them.
List two types of searching and explain how they work.
Sequential - goes through the array and finds the target value
Binary (requires an sorted list) - Starts in the middle of the array and checks if the desired result is in the first or second half of the list by comparing whether the target value is smaller than or larger than the middle value. The other half is then discarded and the process is used for this sub-array until there is only one element left.