Using abstraction, decomposition and algorithmic thinking
Decomposition
Breaking down the problem into smallerones which we might solve individually
Abstraction
Thinking about what information/data is important in the problem, and what details we should ignore
Algorithmic thinking
The logical process of getting from the problem to the solution. The steps needed to build the required algorithms
Computational thinking is a systematic approach to solving problems
Decomposition
Breaking down the problem into smaller ones which we might solve individually
Smaller problems are easier to solve
They can be solved independently of the other problems
They can be tested independently
Then combined to produce the full problem
Abstraction
The process of removing unnecessaryinformation and focussing on the important details
Allows you to develop a general idea of what the problem is and how to solve it
Abstraction
Saving a file on a computer
Using a map
Pseudocode
Fake code, between English and programming code, a language neutral way to represent an algorithm
Pseudocode
Data items to be processed are given meaningful names like variables and constants in high-level programming languages
Algorithm
A sequence of steps to solve a problem
Programming Constructs
Sequence - order in which things happen
Selection - choosing between possible actions (e.g. If, Elif)
Iteration - repeating actions, often referred to as LOOPS (e.g. Forever BLOCK in Scratch, While - Python)
Developers should plan and design before programming
Pseudocode is a clear and concise way to represent an algorithm
Advantages of Pseudocode
Can be done easily on a word processor
Easily modified
Implements structured concepts well unlike flowcharts
Disadvantages of Pseudocode
It's not visual
There is no accepted standard, so it varies widely from company to company
There are many computer languages (e.g. C, Python), most are built from the same basic "building blocks" called programmingconstructs
George Boole (1815 - 1864) was an English mathematician and the author of "Mathematical Analysis of Logic" written in 1847, in which he introduced the world to Boolean logic
Inside a computer there are circuit boards and on these circuit boards are chips which use Boolean logic gates and are the foundation for how computers work
Types of logic gates
AND
OR
NOT
Logic gates
Take some form of input on the left-hand side, process these inputs through the gate and deliver an output on the right-hand side
Logic gate inputs and outputs
Usually represented by a 1 or a 0 to represent true or false
AND logic gate
Has two inputs and one output
If both inputs are true, the output is true
If either or both inputs are false, the output is false
OR logic gate
Has two inputs and one output
If either or both inputs are true, the output is true
Only if both inputs are false, the output is false
NOT logic gate
Has one input and one output
Produces the opposite output to the input (true becomes false, false becomes true)
Solving logic circuits
1. Start from the inputs on the left and work across the diagram
2. Use binary counting to populate the input table
3. Work out the output columns based on the logic gate rules
Logic circuits can have more than two inputs and multiple logic gates combined
Solving logic circuits without a full truth table
1. Determine the output of each logic gate based on the given inputs
2. Work through the circuit step-by-step to find the final output
what gate is this?
a AND gate
What gate is this?
a OR gate
What gate is this?
a NOT gate
Learning the concepts behind your code and learning the terms and how they work and why it's advantageous to do certain things in programming is so important
The difference between an average programmer and a very talented programmer is that the talented programmer understands what's going on in their code
Data types are a means of classifying different types of data
Data types
Determine properties like what operations can be performed on the data and how it will be stored
Basic primitive data types
Integer
Real/Float
Boolean
Character
String
Integer
A whole number
Real/Float
A number with a decimal part
Boolean
One of two values: true or false, 1 or 0
Character
A letter, number or symbol in a given character set