Computer Engineering
Random


Click random to get a fresh chapter.

Computational Thinking Notes




Define being fit for purpose
- The program meets the original purpose and requirements the code was designed for
- Provides expected outputs
- Test tables help to examine the values at each stage


Define efficiency
The amount of time and resources needed to run a particular program


What 3 steps to improve efficiency?
- Using repetition (loops) to reduce the amount of code
- Use arrays instead of declaring many individual variables
- Use selection statements which only make comparisons until a solution is reached


Define abstraction
Using symbols and variables to represent a real-world problem using a computer program and removing unnecessary elements


State 3 advantages of abstraction
- Allows the creation of a general idea of how to solve the problem
- Provides focus on what needs to be done
- Provides a simple view of the problem


Define variables
A box in which data may be stores


Define pseudocode
A mix of English language and code that represents what you want your program to do


What are 2 advantages of pseudocode?
- Flexible
- Less precise than a programming language


Define an array
a data structure that stores a fixed number of values under a single identifier


Define MOD
Modulus means the remainder from a division


Define DIV and give an example
Quotient is integer division (21 DIV 5 = 4)


Define sequencing
Breaking down complex tasks into simple steps


What are 3 disadvantages of sequencing?
- Not very efficient
- Difficult to follow with large programs
- Hard to maintain


What are the 3 types of errors?
Syntax errors, runtime errors, and logic errors


Define syntax errors
When the code doesn't follow the syntax rules of the programming language, stopping the program running


Define logic errors
Where the program runs but doesn't do what it should do


Define runtime errors
Takes place during the running of a program causing a crash


Define decomposition
Breaking down large problems into a set of smaller parts


What are 5 advantages of decomposition?
- Smaller problems are easier to solve
- Each part can be solved independently
- Each part can be tested independently
- The parts are combined which solves the full problem
- Allows each smaller problem to be examined in more detail


What are the 2 sorting algorithms?
Bubble sort and merge sort


What are the 2 searching algorithms?
linear search and binary search


Define a constant
A fixed value used by the program such as pi


What is the advantage of a constant?
It allows easy use of fixed values without having to store them in the program


Define a procedure
A set of instructions stored under an identifier


What is the difference between a procedure and a function?
Functions return a value, procedure doesn't


Define parameters
Values passed into a sub program - they're referred to as arguments when calling the sub program


What are 4 advantages of using sub programs
- Used to save time and simplify code
- Allows the same code to be used several times without it being written out each time
- Easier for someone else to understand
- Can be saved as modules and reused in other programs