P3 Final Term Revision
P3 Final Term Revision
1
2
Electricity on and off
3
Switches inside the computer
• Inside the computer, there are millions of electrical switches.
4
Processor
• The electrical device inside
the computer called processor
uses these on/off electrical
signals and converted into
digital numbers.
On 1
Off 0
5
Digital
6
Digital Device
• Digital devices are things people make to do a useful task.
7
+
8
• Computer can work by combining hardware and software.
Hardware + Software
9
Software
• Software is a set of instructions or program that can tell the
hardware what to do and how to do a task.
• You can’t touch software.
10
Hardware
• Hardware are physical devices that you can see, touch and
hold.
11
Parts of Computer System
Memory/ Storage
12
Processor
13
Input devices
Touchpad Webcam
Game controller Scanner
14
Mouse
15
Keyboard
• A keyboard has buttons on it. These buttons are keys.
• Keyboard can send a signal to computer and tells the computer
which key you chose.
16
Microphone
17
Camera
18
Scanner
19
Output Devices
• Output devices get signals from the processor.
• They are used display or present information from a
computer to the user.
Monitor Printer
Speaker
Projector
20
Monitor
21
Projector
22
Printer
• Printer can give the paper output.
23
Speaker
24
Touchscreen
25
Spam, phishing and pharming
26
27
You should use antivirus software in your
devices. Antivirus programs scan devices
for viruses and remove them if they find.
28
Sequence
• Sequence is a set of steps/tasks/instructions carried out in
order.
• If you follow the wrong order, then you may get ambiguous
or wrong result. Then, the task cannot be achieved.
• Computers need sequences because they lack a mind of their
own nor the intelligence.
29
Algorithm
• An algorithm is a list of steps to solve a problem.
• Algorithms need to have their steps in the right order.
• We carry out many tasks in everyday using algorithms because we are following a
set of instructions to achieve an expected result.
• An algorithm can be expressed in many ways.
Note: We do things in a specific order, because if we didn’t we would not complete the
task properly.
Addition
1. Add the numbers in one place.
2. Add the numbers in ten place.
3. Add the numbers in hundred place.
Loop
• Loop can repeat instructions again and again.
• Loop is used to run specified step repeatedly.
• It is an element that repeats a portion of code until a desired process
is complete.
• Loops are essential to save time, more manageable and minimize
errors.
• For example, we exercised different activities
Write the algorithm to find the treasure. Use the shortest route.
move forward
move forward
move forward
turn right Using loop:
move forward
move forward (loop 3 times)
move forward turn right
turn left move forward for 2 times
turn left
move forward move forward for 6 times
move forward turn right
move forward for 2 times
move forward
move forward
move forward
move forward
turn right
move forward
move forward 33
Bug
• Bug is a mistake in an algorithm or program.
• The bug can be found in a set of sequences or instructions.
• It prevents from working correctly or not allowing to run to
perform a task.
Debug
• Debug means to find and fix errors in a set of sequences or
instructions.
• Usually, debugging is locating the erroneous part, once the
mistake is found, correcting it is usually easy. It has always
been a major part of computer programming.
Do you think computer can make a decision itself?
3
6
Condition
• Condition is a state or situation something is experiencing.
• It is a way for computers to make decisions based on
conditions.
• It always has an if part, tells the computer what to do when
the condition is true and else part, tells the computer what
to do when the condition is false.
• If you leave out the else part, then the computer will do
nothing when the condition is false.
Real life examples
• If I’m hungry then I’ll eat cookies.
• If it rains then stay home.
• If you feel sleepy then sleep.
• If I have 500$ then I’ll buy snacks.
• If you have homework then do it.
40
41
Key terms
• Sprite - an object, or a character, which performs different
actions.