3. Activity
1. One person hides a piece of “treasure” (this could be anything!) in an
indoor or outdoor space.
2. Next, the treasure hider writes out instructions explaining how to find
the hidden object. The instructions need to be very clear so the finder
knows exactly what to do – otherwise, they won’t get to the treasure!
Example:
○ Take 10 steps STRAIGHT
○ Turn RIGHT and take 5 big hops
○ Turn LEFT and crawl 8 times
○ Dig 2 inches down to find the treasure!
3. Once the instructions are written, the finder follows them exactly.
4. If instructions aren’t clear enough, the hider may need to find the bug
and fix it so the finder can successfully reach the treasure.
5. Switch places when finished.
4. Merits of Algorithm
● It is easy to understand.
● An algorithm is a step-wise representation of a solution to a
given problem.
● In Algorithm the problem is broken down into smaller pieces or
steps hence, it is easier for the programmer to convert it into an
actual program.
5. Demerits of Algorithm
● Writing an algorithm takes a long time so it is time-
consuming.
● Understanding complex logic through algorithms can
be very difficult.
● Branching and Looping statements are difficult to
show in Algorithms
7. What is a process ?
The instance of a computer program that
is being executed by one or many
threads.
A thread is the smallest unit of
processing
8. Conditional / Decision Statements
● Conditional statements help you to make a decision based on
certain conditions.
● Conditional statements always have an if part, which tells the
what to do when the condition is true.
● Conditional statements also usually have an else part, which
tells the what to do when the condition is false.
10. Practice - Algorithm to check even or odd number
● If we divide number by 2 and multiply it by 2 if the number is same
then the number (2*N)
● else the number is odd (2*n+1)
Step 1: Start
Step 2: Read a number to N
Step 3: R= N/2 store the
remainder(R).
Step 4: If R = O Then go to Step 6
Step 5: Print “N is odd” go to step 7
Step 6: Print “N is even”
Step 7: Stop
12. Algorithm for angry bird - DIV C
Step1 : https://studio.code.org/join
Step 2: type in their section code: HQYKXB
Step3: fill in the details
Step 4: Follow video instructions carefully and complete the
session
Scan for Certificate
13. Algorithm for angry bird - DIV D
Step1 : https://studio.code.org/join
Step 2: type in their section code: KWJWWJ
Step3: fill in the details
Step 4: Follow video instructions carefully and complete the
session
15. Pseudo code
● It is a methodology that allows the programmer to
represent the implementation of an algorithm.
● Pseudo code, as the name suggests, is a false code
or a representation of code which can be
understood by even a layman with some school
level programming knowledge.
17. Advantages of Pseudocode
● Improves the readability of any approach. It’s one of the best approaches to
start implementation of an algorithm.
● Acts as a bridge between the program and the algorithm or flowchart. Also
works as a rough documentation, so the program of one developer can be
understood easily when a pseudo code is written out. In industries, the
approach of documentation is essential. And that’s where a pseudo-code
proves vital.
● The main goal of a pseudo code is to explain what exactly each line of a
program should do, hence making the code construction phase easier for the
18. The 3 major functions of the input unit are-
● Take the data to be processed by the user.
● Convert the given data into machine-readable
form.
● And then, transmit the converted data into the
main memory of the computer. The sole
purpose is to connect the user and the computer.
In addition, this creates easy communication
between them.
19. ● Central Processing Unit or the CPU, is the brain of
the computer. It works the same way a human brain
works. As the brain controls all human activities, the
CPU too controls all tasks.
● Moreover, the CPU conducts all the arithmetical and
logical operations in the computer.
20. The Arithmetic Logic Unit is made of two terms, arithmetic and logic.
There are two major functions that this unit performs.
1. Data inserted through the input unit into the primary memory.
Performs the basic arithmetical operation on it. Like addition,
subtraction, multiplication, and division. It performs all sorts of
calculations required on the data. Then sends back data to the
storage.
2. The unit is also responsible for performing logical operations
like, AND, OR, Equal to, Less than, etc. In addition to this it
conducts merging, sorting, and selection of the given data.
21. The control unit as the name suggests is the controller of all the
activities/tasks and operations. All this is performed inside the computer.
The memory unit sends a set of instructions to the control unit. Then the
control unit in turn converts those instructions. After that these
instructions are converted to control signals.
22. There are two types of computer memory-
1. Primary memory – This type of memory cannot store a vast
amount of data. Therefore, it is only used to store recent data.
The data stored in this is temporary. It can get erased once the
power is switched off. Therefore, is also called temporary
memory or the main memory.
2. Secondary memory – As explained above, the primary memory
stores temporary data. Thus it cannot be accessed in the future.
For permanent storage purposes, secondary memory is used.
23. The output unit displays the data either in the form of a soft copy or
hard copy. The printer is for the hard copy. The monitor is for the
display. The output unit accepts the data in binary form from the
computer. It then converts it into a readable form for the user.