Computer Science - Introduction to Problem Solving
Computer Science - Introduction to Problem Solving
Computational Thinking
Graphic Novel
Acknowledgement
ADVISORY BOARD
Ms. Deepti Malhotra Ms. R. Umamaheswari
Mr. Surender Pal Sachdeva
(Vice Principal) (In-charge Senior
(Principal)
Secondary)
Script, Dialogue
Technical support Ms. Niharika Hariramani
& (TGT - Computer Science)
Project Coordinator
2
PREFACE
3
INDEX
Topic Page No.
1. Learning Outcomes 5
2. Story Board 6
3. Characters 7
4. Story – Part 1 – Flowcharts and Algorithm 8
(Sequential)
5. Assignment 1 22
6. Assignment 2 23
7. Story – Part 2 – Selection and iteration construct 24
8. Assignment 3 31
9. Story – Part 3 – Pseudocode 32
10. Assignment 4 34
11. Assignment 5 35
12. Bibliography 36
13. Acknowledgement 37
14. Disclaimer 38
4
Learning Outcomes
5
Story Board
6
Characters
7
PART 1 – FLOWCHARTS AND ALGORITHM
(SEQUENTIAL)
One morning, in school, Mohit notices Aisha looking glum and worried. They were
about to take a Computer Science exam.
8
Bell rings and the students
disperse for their examination.
During the exam, Aisha is perplexed by several questions. Mohit, on the other
hand, is relaxed.
9
Mohit catches up with Aisha as they leave the room…..
Ha Ha ! Sure, that
would be great!
Tomorrow 6 PM ?
10
The next day, Mohit meets Aisha at her place.
11
Really? What is
Aisha, you can the problem
actually mediate solving cycle?
a problem using
the problem
solving cycle.
12
For instance maintaining
a library register in a
school can be quite Interesting!
tedious. So,
maintaining the
school library
register, is an example
of identification of a
problem.
Really? This
Let’s consider the same
must be the
example of maintaining
most crucial
the library register. Who
step.
can issue books? What
is the date of issue and
date of return? All these
questions are resolved
in this step via an
algorithm
13
Exactly! Once the
algorithm is finalized,
we use a suitable
programming
language to code it.
This is the third phase.
The Programming
So, programming
language can be
languages come into the
anything. In the Library
picture here!
Maintenance program,
we could use Visual
Basic or Python.
14
1. Debugging is a cyclic
process. Removal of
bugs continues till all
the bugs are eliminated.
That sounds
2. After removal of all simple – almost
the bugs , we install our as if we could
program for live usage. apply it to our
That ends our cycle. daily life!
Absolutely! Actually,
Algorithms are nothing
but a set of simple
instructions
represented in an
orderly manner.
I don’t quite
understand.
15
Let me give you an example Programming in our
from our lives. day to day life!? Are
you sure?
16
Oh my, what a difficult
question! (laughing)
Let me see
-Boil water in a kettle.
-Add coffee to a cup.
-Add boiling water,
-Add milk and then Add
sugar.
And your coffee is ready!
17
And that my friend, Really!? You are
is an algorithm! joking, right?
…..
1) Start
2) Get two numbers N1
and N2
For computers, we need to add a 3) S N1 +N2
‘Start’ and ‘Stop’ step to each
algorithm. 4) Print the result
Let’s take a simple mathematical 5) Stop.
program to add two numbers. The
steps in the algorithm will be …
18
That is Now, lets
great! take the
It all coffee
makes example
sense and apply
now! it to
flowcharts.
…which are a graphical
representation of the
logic!
FLOWCHARTS
START
ADD MILK
ADD SUGAR
END
19
There are several other
symbols for different purposes.
Let’s take a look at them…
20
Flowchart for
Two Number
addition Aisha solves the problem and shows it to Mohit
How’s that,
Perfect!
Mohit?
21
Assignment 1
Across
1. I am a rectangle in a flowchart. What do I represent?
2. In this box conditions can be given
4. You can use me to communicate ideas, graphically represent
a problem solving.
5. I connect two geometrical boxes in a flowchart
Down
1. In the flowchart, I represent data or information that is
available.
3. All flowcharts begin with me. I am elliptical in shape
22
Assignment 2
The flow chart on the right
hand side shows the steps
to close all the applications
on your computer and shut
down.
23
PART 2 - SELECTION AND ITERATION CONSTRUCT
Yes, you
are.
START
Yes If No
Age>=18
?
Not Eligible to
Eligible to vote
vote
STOP
25
Aisha’s mother enters the room
You are
welcome, dear!
26
Later, Aisha and Mohit continue with their studies.
Oh, okay! So
a loop is also a
A loop is a sequence of condition driven
instructions that is executed statement.
several times as long as a
predefined condition is True.
27
Right! Consider any sequence of events in your life that
are repeated and you'll see an example of a loop. Let us
consider buses in transit systems of circular route. They
are good examples of loops. The bus goes round the
decided route till it is time for it to stop.
1) Start
2) Input N, the number for which
multiplication table is to be printed.
3) For T = 1 to 10
4) Print M = N * T
5) End For
6) Stop
In this example, the number 10 given in the loop is working as a loop breaker, which terminates
the loop when the value of ‘T’ reaches to 10.
29
START
Enter Num
Set count = 1
Count<=10 False
?
True
Result= STOP
count * Num
Print Num
Count = count + 1
30
Assignment 3
Write the algorithm to find the sum of 5 numbers,
Algorithm
31
PART 3 - PSEUDOCODE
By the way,
what is exactly
the difference
between
algorithms and
pseudocodes?
32
This captures the essence of the
program and can now be written in
any programming language.
What are
friends for?
Aisha, I am glad
Thank you Mohit for
that I could help
making me realize
you.
that programming is
not just about rote
learning. It is concept
driven subject.
33
Assignment -4
Find the words given below in the word search puzzle. The words
can be placed vertically, horizontally or diagonally.
34
Assignment -5
1) INPUT Number
IF (0<= Number) AND (Number <= 100)
ACCEPT
Else
REJECT
a) On what values will this algorithm fail?
b) Can you improve the algorithm?
35
BIBLIOGRAPHY
- Computer Science – CBSE Textbook
- Python with Computer Science by
Dhanpat Rai & Co.
36
Principal’s Message
37
This story is an original creation by the author. All the
characters in this novel are fictional. All the images used
are hand-made illustrations made by Art department.
The concepts of this novel has been explained through
fictional characters. All the technical terms are verified
and are as per the curriculum.
38