CHAP#2 CLASS 9TH COMPUTER SCIENCE
1. What is the major difference in solving simple problems and complex problem?
A: The major difference in solving simple and complex problems is that simple problems use a 4-step
process(define, design, implement, and evaluate),while complex problems use a more detailed 6-steps
process(define, decompose, identify potential plans, select the best plan, implemented and evaluate).The
complex problem solving process involves breaking down the problem into sub-problems and considering
multiple potential solutions before selecting best one.
Q2.Why software designers prefer to use IPO charts?
A: software designers prefer to use IPO charts because they visually represent the inputs, processes, and
outputs in a clear and organized tabular form, making it easier to solve problems and understand the flow of
data through the system.
Q3. Differentiate between computational and logical thinking.
Aspect Computational thinking Logical thinking
Definition Involves problem solving techniques Refers to reasoning based on
used in computer science. principles of logic.
Application Used in various fields including Applied in mathematics,
computer science, engineering, etc philosophy, and everyday
reasoning.
components Decomposition, pattern recognition, Deduction, induction, inference.
abstraction, algorithm design.
Q4.Write four properties of computational thinking.
A: Following are four properties of computational thinking.
1. Decomposition: Breaking down the complex problems into smaller, manageable parts.
2.Pattern recognition: identify similarities or patterns among different problems or
data sets.
3. Abstraction: focusing on the important details while ignoring irrelevant information.
4. Algorithm Design: creating step by step instructions or algorithms to solve problems.
Q5.What are the methods used to design a solution?
A: There are two methods that are used to design a solution flowchart and concept Maps
6. Which computational thinking technique breaks down the problem into smaller your parts?
A: In computational thinking process, Decomposition breaks down the problem, into smaller, more
manageable parts.
Q7.Identify 3 computing problems from other subjects that you are studying in your class.
A: Following are three examples from other subjects in the class 9th.
1. Mathematics: Developing a program to solve quadratic equations or to perform complex mathematical
operations.
2. Physics: Simulating physical systems and phenomena using computational models to analyze motion,
forces, or electromagnetic fields.
1
3. English: Developing a program that analyzes text for grammar and spelling errors, similar to spell
checkers or grammar correction tools.
Q8:Why do we need to think computationally?
A:We need to think computationally because it helps us solve complex problems, creating solutions, and
preparing for a technology-driven world.
Q9: The telephone numbers usually have 9 digits. Out of 9,the first two digits represents the area code
and are it remained constant within a given area.The last 7 digits represents the number, and it
cannot begin with 0..how many different telephone numbers are possible with a given area code.
Let's break down the problem step by step:
The telephone number has 9 digits in total.
The first 2 digits are the area code, which is constant within a given area.
The last 7 digits represent the number itself, and it cannot begin with 0.
Calculation:
1. First digit of the 7-digit number: Since it cannot be 0, there are 9 possible
choices (1-9).
2. Remaining 6 digits: Each of these can be any digit from 0 to 9, so there are 10 choices for
each. Now, let's calculate the total number of possible 7-digit combinations:
The first digit: 9 choices.
The remaining 6 digits: 10×10×10×10×10×10=106 choices.
Therefore, the total number of different telephone numbers possible with a given area code is:
9×106=9,000,000
There are 9,000,000 different possible telephone numbers for a given area code.
Q10.From city A to city B, there are 4 different roads and from city B to city C there are 2 different roads.
Draw a map of given situation and identify how many possible routes are there that someone can
follow to reach from city A to C passing by city B?
Here's the map showing three cities (A, B, and C) with 4 different roads connecting city A to city B and 2
different roads connecting city B to city C.
To find the total number of possible routes from city A to city C passing through city B, you multiply the
number of roads from A to B by the number of roads from B to C:
4×2=8
So, there are 8 possible routes from city A to city C via city B.
Detailed questions:
Give Long answers to the following extended response questions (ERQs).
Q1. Identify whether the given problems are Decision Problems, Counting Problems or Search
Problems. Write your answer in front of each problem given below:
a. Does a given binary string have an even number of zeros? Decision Problem
2
This is a decision problem because it asks for a simple yes or no answer regarding whether the condition(an
even number of zeros)is met.
b. Flipping a coin results in Head or tails. I flip a coin 20 times, how many different sequences of heads
and tails are possible? Counting Problem
This problem involves counting the number of possible outcomes of flipping a coin 20 times.
c. Does a certain Java program say “yes” to an empty input? Decision Problem
This also a Decision problem because it requires a binary answer(yes or no)to whether the program outputs
”yes” for a specific input(in this case, an empty output)
d. How many ways can the letters of the word TRIANGLE be arranged? Counting Problem
This problem involves counting the number of arrangements of the letters in the word TRIANGLE.
e. N-queens problem: where the goal is to place eight queens on a chessboard such that no queen attacks
any other. Search Problem:
This can be viewed as a search problem because it involves finding an arrangement of queens on the chest
board that satisfies the given condition.
Q2. A student has to take one course in physics, one in science and one in mathematics. He may choose
one of 3 physics courses (P1, P2, P3), one of 2 science courses (S1, S2) and one of 2 mathematics
courses (M1, M2). In how many ways can this student select the 3 courses he has to take?
To find the total number of ways the student can select the 3 courses, we multiply the number of options for
each subject:
Number of physics courses to choose from = 3 (P1, P2, P3)
Number of science courses to choose from = 2 (S1, S2)
Number of mathematics courses to choose from = 2 (M1,
M2) So, the total number of ways to select the courses is:
3×2×2=12
Therefore, the student can select the 3 courses in 12 different ways.
Q3. Create an IPO chart which will accept the ages of four boys and calculate their total age and
average age. The program must display both the total age and the average age.
3
3. Create an IPO chart of a scenario that allows a user to enter two numbers. The operation to
be performed is either addition, subtraction, multiplication or division and accordingly the
output should be given to the user.
Q 5. The child wants to plan a birthday party for their friend. a) Draw an IPO chart of this situation.
b) Write down properties of computation thinking.
a) IPO Chart for Planning a Birthday Party:
b) Properties of computational thinking
The following are the properties of computation thinking:
Decomposition: Breaking down the larger task of planning a birthday party into smaller, more manageable
parts and working on them one by one such as selecting a theme, choosing a location, planning activities,
arranging food, and managing invitations. These smaller problems are referred as sub-problems. This way
we simplify the problem and solve it easily.
Abstraction: Focusing on the essential aspects of the birthday party planning process while ignoring
irrelevant details, such as specific decoration designs or individual guest preferences.
Pattern Recognition: Identifying common elements or patterns in birthday party planning, such as typical
activities, popular themes, or preferred foods, to make informed decisions.
Algorithm Design: This involves creating step-by-step procedures or plans to organize the birthday party
efficiently, ensuring that all necessary tasks are completed in the right order to achieve the desired outcome.
4
Chap#2 Lab activities
Activity 1
Draw a flowchart in MS Visio that takes input of two numbers A and B and output True if A is Greater
than B
otherwise it should output False.
Activity 2
Draw IPO chart and algorithm of a given number: Exponent or power of a number means how many
times to use the number in a multiplication. In other words, it is the product of a number that is
multiplied as many times as the exponent.
Input Process output
Base number Multiply the base result of the
Exponent(n) number by itself n times exponent
Algorithm:
Step 1: let the base number be Base, and the exponent be n.
Step 2: initialize Result=1 and count =1
Step 3: if count <=n
Step 3.1: Multiply Result by Base (Result =Result*Base)
and repeat until condition is true
Step 3.2 count=count+1
Step 4: if no Display result
5
b) Print odd numbers from 1 to 100.such as 1 3 5 7 9 11.........99
Input Process Input
number check each number Display odd numbers
(1 to 100) from 1 to 100 and from 1 to 100
print it is odd
Algorithm:
Step 1: Initialize i=1.
Step 2: check if i is less than or equal to 100.
Step 3: if i % 2 ≠0 ,print i.
Step 4: Increment i by 1.
Step 5: Repeat steps 2 to 4 until I >100.
c) Print the following sequence of numbers in descending
order. 27 24 21 18 15 12 9 6 3 0
Input Process
output
Starting number(27) Start at 27 and
Display the sequence
Decrement value(3) Subtract 3 until
(27,24,21,…..,3,0)
Ending number(0) reaching 0.
Algorithm:
Step 1: Initialize i=27.
Step 2: Check if I greater than or equal to 0.
Step 3: Print i.
Step 4: Subtract 3 form i.
Step 5: Repeat steps 2 to 4 until i<0.
6
d) Find the sum of even numbers up to
100. SUM= 2+4+6+8+10+12+14+……+100
Process output
Input
Add even number Display the sum of
number(2 to 100)
from 2 to 100. even numbers.
Algorithm:
Step 1:initialize sum=0 and i=2.
Step 2: check if i is less than or equal to 100.
Step 3: add i to sum (sum=sum + i).
Step 4: increment i by 2.
Step 5: repeat steps 2 to 4 until i >100.
Step 6: Display sum.
e) Print a multiplication table of a given number.
Input Process Output
Number for which Multiply the number Display the
The multiplication by integers from 1 to Multiplication table.
table is needed. 10.
Algorithm:
Step 1: input the number.
Step 2: initialize i =1.
Step 3: check if i is less than or equal to 10.
Step 4: Print”number * i = result”.
Step 5: increment i by 1.
Step 6: repeat steps 3 to 5 until i>10.
7
Activity 3
Convert the algorithms of lab Activities given in Q2 into flowcharts.
(a) (b)
8
( c) (d)
(e)
9