9th Computer Exercise Ch2
9th Computer Exercise Ch2
Exercise c) Sort
d) None of above
Select the suitable answer for the following
7. In IPO Charts, we have:
Multiple-choice questions.
a) Input, Plan, Output
1. For a problem, we face in real world b) Input, Program, Output
situations. In what sequence we follow c) Input, Process, Output
the steps. d) Input, Proceed, Output
I. Make some solution.
II. Understand the real-world
problem.
III. Instruct the computer to behave
accordingly.
a) I, II, III
b) I,III,II
c) II,I,II
d) II,III,I
2. Following are types of computing
problems.
I. Counting Problems
II. Search problems
III. Decision problem
a) I and II
b) I and III
c) II and III
d) I and II and III
3. Computational thinking is :
a) Programming
b) Thinking like a computer
c) Coding
d) Logically solving problems
4. To solve search problems, we need to :
a) Provide the moves.
b) Provide start state
c) Provide the end state
d) a ,b and c
5. The eight queens puzzle is the problem
of :
a) Sorting
b) Searching
c) Counting
d) Both a and b
6. Finding the location of the element with
a given value is :
a) Search
b) Traversal
abstraction, and
algorithms
Give Short answers to the following short
Focuses on creating Focuses on human
response questions (SRQs).
solutions that can be reasoning and
1. What is the major difference in solving executed by computers understanding
simple problems and complex
problems?
4. Write four properties of Computational
Solving Simple Solving Complex thinking.
Problems Problems
Properties of Computational Thinking:
Unclear or evolving
Clear understanding of understanding of the i. Decomposition: Breaking down complex
the problem. problem problems into smaller, manageable parts.
Many interconnected ii. Pattern Recognition: Identifying
Few variables involved variables similarities or patterns to solve problems
Solutions are Solutions are uncertain efficiently.
straightforward and and may require iterative
predictable approaches iii. Abstraction: Focusing on important
information while ignoring irrelevant
details.
2. Why software designers prefer to use
IPO charts? iv. Algorithm Design: Creating step-by-step
instructions to solve problems.
Ans: 1. To visually represent the IPO model.
2. It is tabular form which is easy to understand. 5. What are the methods used to design a
3.It is considered as a handy tool that software solution?
designers use to solve problems. There are two methods that area used to design a
Example: solution:
I P O i. Flowcharts: Diagrammatic
representation of an algorithm.
Input Process Output
It describes what operations are
Data entered Operations Data that ha
required to solve a given problem.
in the system that will be been turned
applied on the into the Start
input information
Input
Processing
3. Differentiate between Computational
output
thinking and Logical thinking.
End
Computational
Thinking Logical Thinking
ii. Concept Maps: It is graphical tool
Solving problems using
that represents concepts and
computer science Solving problems using
relationship between them.
concepts reasoning and logic
Involves decomposition, Involves deduction,
pattern recognition, induction, and reasoning
Unit 2 Prepared by Mughis Raza Computational Thinking & Algorithms
Page 3
o Area Code: The first 2 digits are many possible routes are there that
fixed and represent the area code. someone can follow to reach from city A
to city C passing by city B?
o Number Part: The last 7 digits
represent the actual phone number Problem Explanation
and cannot start with 0.
• 4 different roads from City A to City B.
2. Calculating the Possibilities:
• 2 different roads from City B to City C.
o First Digit of the Number Part:
Drawing the Map
Since it cannot be 0, it can be any
digit from 1 to 9. So, there are 9 City A (4 roads) City B (2 roads) City C
possible choices.
Calculating the Number of Possible Routes
o Remaining 6 Digits: Each of these
Multiplying the number of choices for each part of
can be any digit from 0 to 9. So,
the journey:
there are 10 possible choices for
each digit. 1. From City A to City B: There are 4
different roads.
3. Total Combinations:
2. From City B to City C: There are 2
o First Digit: 9 choices (1-9)
different roads.
o Each of the Remaining 6 Digits:
(roads from A to B) (roads from B to C)=total routes
10 choices (0-9) 4 x 2 = 8 routes
Example:
• Possible Numbers:
120000001 (First)
120000002
.............
............
.............
129999999 (Last)
Reason: This problem also asks for a yes or i. Physics: 3 options (P1, P2, P3)
no answer. You need to decide if the Java program ii. Science: 2 options (S1, S2)
will output “yes” when given no input. iii. Mathematics: 2 options (M1, M2)
There are 12 different ways for the student to Operation (add, 2. Accept the
select one course each from physics, science, and subtract, operation to be
mathematics. multiply, divide) performed
(addition,
Reason: We multiply the number of choices for
subtraction,
each subject because each choice is independent
multiplication, or
of the others.
division).
3. Perform the
chosen operation:
Q3. Create an IPO chart which will accept the
i. If addition: result
ages of four boys and calculate their total age
= num1 + num2
and average age. The program must display
both the total age and the average age.
ii. If subtraction:
Ans: result = num1 -
num2
IPO Chart:
I P O iii. If
Input Processing Output multiplication:
Ages of four 1. Accept the 1. Total age of result = num1 *
boys (age1, ages of four the four boys. num2
age2, age3, boys. 2. Average age
age4) 2. Calculate the of the four Q5. The child wants to plan a birthday party
total age: total boys. for their friend.
age = age1 +
age2 + age3 + a) Draw an IPO chart of this situation.
age4 I P O
3. Calculate the
Input Processing Output
average age:
Friend’s Gather information A detailed
average age =
preferences about the friend’s plan for the
total age /4
(theme, preferences. birthday
food, party
Q4. Create an IPO chart of a scenario that activities) Set a budget for the
allows a user to enter in two numbers. The party.
operation to be performed is either addition, Budget for
subtraction, multiplication or division and the party Create a guest list.
accordingly the output should be given to the
user. Guest list Choose a date and
time for the party.
I P O
Date and
Input Processing Output time of the Select a venue based
Two numbers 1. Accept two Result of party on the budget and
(num1, num2) numbers from the the chosen preferences.
user. operation Venue
options