SlideShare a Scribd company logo
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS
!
Iriit 1: Problem Solvin;
^HLongQuestions
^l
g
Q.l Define problem analysis. Explain your answer along with an example.
Ans:
The process of understanding the problem for developing its solution is called analyzing the
problem. It is important to understand the problem before jumping into the solution of the
problem,
Identification of the 5 Ws:
Understanding of a problem usually includes identification of the 5 Ws (what, who, when,
where, and why). Problem analysis is the process to figure out these 5 Ws from a problem
statement.
Example 1: Suppose your class teacher assigns you a task to prepare a list of students in your
directory of all school students and there is only one week to complete the task school whose
names start with letter 'A'. The list is required in order to prepare an alphabetical directory of
all school sudents and there is only one week to complete the task.
We can analyze this problem by identifying 5Ws in the problem statement as given below:
• What: List of students names starting with letter 'A':
• Who: Students.
• Why: To prepare the directory of students.
• When: Within a week.
• Where: School
Example 2: Suppose you prepare a list oftop 10% students in computer science subject in your
class within a week. We can analyze this problem by identifying 5Ws in the problem statement
as given below:
• What: A list of top 10% students in computer science subject in your class.
• Who: Students.
• Why: To prepare the list of top 10% students in computer.
• When: Within a week.
• Where: School
Q.2 Define an algorithm and argue on its role and importance in problem solving.
Ans:
An algorithm is a finite set of steps, which, if followed, accomplish a particular task. It is
written in a natural language, so it is easily understandable by humans. Usually an algorithm
takes an input and then after processing produces some output.
Role of Algorithms in Problem Solving
• Formulating an algorithm is the first step for developing a computer program.
[PAGE: 1 OF 181
[WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1
• An algorithm has a vital role in problem solving as it provides a step-by-step guide to
the problem solver.
• It is a complete description of the solution.
• A computer programmer first writes an algorithm and then translates it into the code
of some programming language.
Importance of Algorithms in Problem Solving
• To solve a large problem, algorithms are helpful.
• Easy to write.
• Techniques to write an algorithm are easy to understand.
Example 1: For example, to solve the problem of preparing tea, we can follow the following
steps:
Step 1: Start
Step 2: Take a kettle
Step 3: Pour water in it
Step 4: Put the kettle on fire
Step 5: Add sugar, milk and tea
Step 6: Wait till it boils
Step 7: Remove the kettle from fire
Step 8: End
Example 2: To find the sum, product and average of five given numbers.
Step 1. Start
Step 2. Input numbers, a, b, c, d, e
Step 3. Set sum toa + b + c + d + e
Step 4. Set product t o a x b x c x d x e
Step 5. Set average to (a + b + c + d +e ) / 5
Step 6. Output sum, product, average
Step 7. End
Example 3: To find acceleration of a moving object with given mass and the applied force.
Step 1. Start
Step 2. Input numbers, mass, force
Step 3. Set acceleration to force/ mass
Step 4. Output acceleration
Step 5. End
Example 4: To find the volume of a cube.
Step 1. Start
Step 2. Input number, side
Step 3. Set volume to side x side x side
Step 4. Output volume
Step 5. End
[PAGE: I OF 181
[EMAIL: FREEILM786
@
GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS
!
Q.3 Suppose a problem has multiple algorithms. How would you choose the most efficient
one? Explain with example.
Ans:
There can be more than one algorithms to solve the same problem. Which one is better, depends
upon the efficiency ofthe available solution algorithms. Efficiency of an algorithm is measured
on the basis of two metrics:
1. Number of steps: An algorithm is considered more efficient if it takes less number of steps
to reach the results.
2. Space used in computer memory: We have observed in algorithms that some data is stored
in computer memory which is later used to give results. An algorithm using less space in
computer memory is considered more efficient with respect to memory space.
It is quite possible that one algorithmtakes less space in memory and has more number of steps
whereas the other algorithm takes more memory and has less number of steps. Inthis case there
is a trade-off between number of steps and the consumed memory. The designer can take
decision according to the requirements.
Example
Let's suppose we have two algorithms to solve a certain problem. One algorithm has N steps
whereas the other algorithm has N2 steps. In this case the first one is considered more efficient
than the first one.
Example
We need to compute the following.
1 +2 +3 +4 +5 + ... + 99
How can we find its answer?
Different minds can find different solutions to solve this problem.
1. One solution is to start adding numbers from beginning and keep adding till the end.
2. Other solution is to start making pairs as (1 +99), (2 +98), (3 +97), (4 + 96), (5 +95) ...
(49+51) where each pair gives answer 100. We count the number of pairs and multiply that
count with 100 and then in the result we add 50 as it is nowhere in any pair.
3. Another solution is to use formula
n(n+V where n is the last term. So, the solution is just to
99 (99+1)
solve
These examples shows different approaches to solve one problem and if these approaches are
used in computer then accordingly there may be different memory usage and number of steps.
Third step is better because it use less number of stepsto reach the result and also consume less
space in computer memory.
2
Q.4 How do you determine requirements for a flowchart? OR Write steps for drawing a
flowchart.
Ans:
Flowchart is the graphical or visual representation of an algorithm to solve problem using
symbols. The flowchart developer must determine the following requirements for the given
problem or algorithm before drawing a flowchart:
• Input to the flowchart
• Type of processing required
PAGEt 3 OF 181
[WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS
!
• Decisions to be taken
• The output to be produced after processing
1. Input: The flowchart developer must know about the input for flowchart.
Example: If the giver problem is to find area of rectangle. Here inputs will be length and width
2. Processing: The flowchart developer must decide whattype of calculation is to be performed
or which formula is to be applied to obtain the required result
Example: To the find the area of rectangle, the following formula is to be used
Area = Length * Width
3. Decision: The flowchart developer must decide which control structures (sequence,
repetition or selection) are to be applied for the solution of the problem.
Example: To find the largest number from any three given numbers...
4. Output: The flowchart must be provide the required output.
Q.5 What is test data? Describe types of test data.
Ans:
Test data is used to test whether the solution of the problem is correct or not. After solving a
problem, we need to test whether the solution is correct or not, and for testing, we need "Test
Data".
Importance of Testing
• Testing is essential to point out the defects and errors made during finding a solution
to some problem.
• It helps in improving a solution. If one solves a problem and someone else uses that
solution for commercial purposes, then the commercial activities depend upon the
correctness of that solution.
Example 1: if we develop a solution for finance management and some bank starts using it
then any error in that solution may result in a financial loss. So, testing is important for a
solution.
Example 2: A car is delivered to a customer after testing. Upon launching a new car, it is
usually tested with a robot driver who hits the car with a wall. It is used to test whether the air
bags and other security systems are functioning or not. Moreover, it also allows the car
designers to suggest further security measures to reduce the damage. This test can help to make
a car safe. So testing helps to improve quality.
Types of Test Data
Following are the types of test data.
Valid test data: It is data that is valid with the input requirement of the algorithm.
Example: If an algorithm is supposed to take a numeric value between 1 and 50 as input, then
any value between 1 and 50 is a valid test data.
Invalid test data: It is data that is invalid with the input requirement of the algorithm.
Example: If an algorithm is supposed to take a numeric value between 1 and 50 as input, but
that input is not between 1 to 50 so it is invalid test data.
Boundary test data values: A solution is tested on extreme values.
Example: To calculate interest we can consider principal amount as 0 or a very huge amount.
Absent data: It is also important to investigate that the solution still works if less number of
inputs are given than expected.
[PAGE; 4 OF 181
[WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS
!
Example: If a system asks to enter driving license number, then everyone cannot provide this
information. It is important to see how the system reacts in such situations.
Wrong data formats: It is wise to check how the system reacts on entering data in wrong
format. Example: Giving a numeric value as input when alphabet is expected.
Q.6 Describe identification and correction of errors using a trace table.
Ans:
If an algorithm is failed during verification, then it is important to identify the root cause of
failure and then to correct it. Sometimes the error is logical. It means the solution is working
but not giving required results.
For example, to recruit students for our school volleyball team, we need students having
height between 144 cm and 164 cm. To count qualified students, we develop the following
algorithm.
Step 1. Start
Step 2. Set count to 0
Step 3. Set all heights to [154, 140, 155, 164, 144, 166, 160, 143]
Step 4. For each height in the list all-heights
Step 5. If height > 144 and height < 164 then set count to count + 1
Step 6. Output count
Step 7. Stop
The above algorithm works but does not count all students. There is a deliberate error
on Step 5. The symbol > has been used instead of > before the number 144. So, the students
having height 144cm will not be counted. This is a logical error. We can identify this type of
errors using a trace table.
Trace table:
A trace table is a technique used to test algorithms, in order to make sure that no logical errors
occur while the algorithm is being processed. The table usually takes the form of a multi-
column, multi-row table; with each column showing names of data, and each row showing
values of the data at each step.
Example: To recruit students for our school basketball team, we need students having height
between 144 cm and 164 cm.
Table shows a trace table for the algorithm. The blank means there is no change and —means
that a value is not concerned. In the following table Step 1 has no effect on data. Step 2 is
assigning 0 to count and in Step 3, list all heights is introduced. In Step 4, there is no change in
both count and all heights but the data 154 is stored in height. It is compared in Step 5 and the
value in count is updated if data is in given range. Steps 4 and 5 are repeated for each value as
shown in Table.
Count All heights height
Step 1
Step 2 0
Step 3 [154, 140, 155, 164, 144, 166, 160, 143]
Step 4 154
Step 5 1
PAGEt m OF 181
[WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1
Step 4 140
Step 5 1
Step 4 155
Step 5 2
Step 4 164
Step 5 3
Step 4 144
Step 5 3
Step 4 166
Step 5 3
Step 4 160
Step 5 4
Step 4 143
Step 5 4
Step 6
Step 7
Q.7 What do you mean by problem solving? Describe the problem solving process.
Ans:
Problem: A problem is an obstacle, hurdle, difficulty or challenge, or any situation that needs
to be removed or solved.
Problem solving: Problem - solving is a skill which can be developed by following a well-
organized approach. Programming is also a problem solving activity. Solving problems is the
main task of computer science which is the job of computer programmer. Programmer must
first understand how a human solves a problem then translate it into a set of instructions in a
programming language that a computer can understand and execute.
The following five Steps involved in problem solving process.
1. Defining a Problem
2. Understanding a Problem.
3. Planning a Solution.
4. Defining Candid Solutions.
5. Selecting the Best Solution
1. Defining the Problem
Defining the problems is initial stage of problem solving. A well-defined problem is the one
that does not contain any ambiguities. All the conditions are clearly specified and a clear goal.
When we are going to solve some problem first we need to see whether the problem is defined
well or not. If the problem is not defined well first of all define the problem. If the problem is
not defined well then we can use one of the following strategies to define the problem.
Strategies to define the problem.
• Gain Background Knowledge
[PAGE: 6 OF 181
[EMAIL: FREEILM786
@
GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS
!
We try to know the situation and circumstances in which the problem is happening. In
this way, we can identify the given state. It also helps to know what' a good solution
will look like. How we shall be able to measure the solution
• Use Guesses
We try to guess the unknown information through appropriate guesses. These guesses
may be based upon our past experiences.
• Draw a Picture
If the problem is not well-defined, we can draw a picture and fill the undefined
information.
2. Understanding a problem
The process of understanding the problem for developing its solution is called analyzing the
problem. It is important to understand the problem before jumping into the solution of the
problem. Understanding of a problem usually includes identification of the 5 Ws (what, who,
when, where, and why).
Example 1: Suppose your class teacher assigns you a task to prepare a list of students in your
school whose names start with letter 'A'. The list is required in order to prepare an alphabetical
directory of all school students and there is only one week to complete the task.
We can analyze this problem by identifying 5Ws in the problem statement as given below:
• What: List of students names starting with letter 'A'.
• Who: Students.
• Why: To prepare the directory of students.
• When: Within a week.
• Where: School
3. Planning the solution of the problem
Planning the solution of the problem is a creative stage of problem solving. It refers to dividing
the solution into steps and arranging them into proper order that will solve the problem.
Strategies for Planning a Solution
Following are the strategies that depend upon the nature of problem:
• Divide and Conquer: This strategy divides a complex problem into smaller problems.
• Guess, Check and Improve: The designer guesses a solution to a problem and then
checks the correctness of the solution. If the solution is not according to expectations,
then he/she refines the solution.
• Act it Out: In this strategy the designer defines the list of "to-do" tasks. Afterwards
he/she performs the task
• Prototype (Draw): This technique draws a pictorial representation of the solution. It is
not the final solution. However, it may help a designer to understand the important
components of the solution.
4. Candid solutions of a problem
All the possible solutions of a problem that produce correct result are known as candid
solutions. The word candid refers to something spontaneous and unplanned. One can think of
a candid solution anytime. A candid solution can help to save time. It is not necessary that the
candid solution is the actual solution of a problem.
[PAGE: H OF 181
[WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS
!
5. Select the best solution
After defining the candid solutions, only one solution can be selected. The selection of final
solution of a problem should be based on the following criteria.
Speed: The selected solution of the problem should be efficient
Cost: The selected solution of the problem should provide a cost-effective way of
implementation.
Complexity: The selected solution ofthe problem should not be complicated. It should contain
minimum number of instructions/simple steps.
Q.8 Explain Candid Solutions with example.
Ans:
The word candid refers to something spontaneous and unplanned. All the possible solutions of
a problem that produce estimated result are known as candid solutions. To find candid solutions
of a problem, programmer has to look for different methods to solve the problem and come up
with several solutions. A candid solution can help to save time It is not necessarythat the candid
solution is actual solution of problem.
Example: If you are asked to find number of students in your school who can play football.
You can estimate by finding football players in your class and then multiplying it by the total
number of classes in your school. Your answer inthis way is the candid solution. To find exact
number of football players, you have to choose some other way, like visiting each class or
getting data from teachers.
Q.9 What are importance of flow chart in solving a problem? Describe symbols that are
used in flowcharting.
Ans:
Flowchart:
Flowchart is the graphical or visual representation of an algorithm to solve problem using
symbols.
Importance of flow chart in solving a problem
• With the help of a flowchart, the logic of an algorithm can be described more
effectively.
• Flowchart illustrates the sequence of operations to be performed to solve a problem in
the form of a diagram.
• Computer programmers draw flowcharts before writing computer programs. It
provides an easy way to analyze and find solutions of problems.
• Once, the flowchart is drawn, it becomes easy to write program in any high level
language.
• The flowchart helps in debugging process.
Flowchart symbols
PAGE; 8 OF 181
[WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1
Symbol Name Description
Flow line this symbol shows the flow of data, information or process in
the flowchart.
Terminal An oval shape symbol that represents the Start and End of a
flowchart.
I I A Rectangle shape symbol is used to represent the process or
action taken or shows all the calculations.
Process
Symbol Name Description
o Decision A diamond represents a decision symbol used for comparison or
a decision. It changes the flow of control and decides a particular
path to be followed.
CD Input/output A parallelogram represents either input or output operation
regardless of the input or output method.
O Connector A small circle represents a connector symbol and is used to join
various parts of a flow chart.
Q. 10 Draw a flowchart to find the sum, product and average of five given numbers.
Ans:
Start
z 7
Input nO, n1, n2, n3, n4
Sum = nO + n1 + n2* n3* n4
Product = nO x n1 x n2 x n3 x n4
Avg = [nO + n1 + n2 + n3 + n4) / 5
z 7
Print Sum, Product, Avg
End
[PAGE
:9 OF 181
[WEBSITE: [EMAIL: FREEILM71 JL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1
Q. 11 Draw a flow chart to display the large one out of three given unequal numbers. OR
Draw a flowchart to find largest of three numbers.
Ans:
METHOD 1
Start
> r
Input nO, n1, n2
i r
Large = nO
No
n1 > Large
Yes
Large = n1
Yes
n2 > Large
Large = n2
No
1 r
J Print Large
7
Stop
METHOD 2
[WEBSITE: WWW.FREEILM.C0M1 [PAGE: 18 OF 181
[EMAIL: FREEILM7868GMAIL.C0M1
[ WEBSITE: WWW.FREEILM.COMl [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS!
Q.13 Draw a flowchart to determine name of a week day form a given number where
weekdays are assumed from Monday to Smiday and their respective numbers from 1 to
7.
Ans:
Start
’r
Input
number day
Mo Yes
y'Piint "Monday
Day is 1
Mo Yes
WPrint"Tuesday
/
Day is 2
i r
-
^rint 'Wednesday
/'’’'
Yes
Mo
Day is 3
v
Mo Yes
/Print "Thursday
/
Day is 4
y
Print "Friday"
/
Mo Yes
Day is 5
-
/Print 'Saturday
/''
Mo Yes
Day is 6
' f
Yes / /
y Print "Sunday"/
Day is 7
1
Mo y y y y y
<
Stop
[PAGE: 13 OF 18l
[ WEBSITE: WWW .FREEILM.C0M1 [ EMAIL: FREEILM7860GMAIL .COM!
[ WEBSITE: WWW.FREEILM.COMl [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS!
Q. 14 Draw a flowchart to input 5 values one by one and determine if the given value is
odd or even.
Ans:
Start
'f
count = 0
'f
Input number n
i r
Increase count by 1
i f
Rem = n mod 2
Yes Wo
Rem is 0
'r
Print n is even Print n is odd
Wo
Count = 5
Yes
i r
Stop
[PAGE: 14 OF 18l
[ WEBSITE: WWW .FREEILM.C0M1 [ EMAIL: FREEILM786@GMAIL .C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1
Q. 15 Draw a flowchart to find a sequence of odd numbers starting from a given nmnber
till some limit.
Ans:
Start
i r
zInput number n, limit
Rem = n mod 2
Yes Wo
Rem is 0
Increase n by 1
*
Yes No
n < = limit Stop
I
Print n
Increase n by 2
Q.16 What is algorithm? Explain formulation of algorithm with examples.
Ans:
An algorithm is a finite set of steps, which, if followed, accomplish a particular task. It is
written in a natural language, so it is easily understandable by humans. Usually an algorithm
takes an input and then after processing produces some output.
Formulation of an Algorithm
There are different notations (keywords) to write an algorithm given below in table:
[WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786
@
GMAIL.C0M1 [PAGE: 15 OF ISl
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1
Notation
Start
Meaning
It is the starting point of an algorithm. Every algorithm must have one starting
(entry) point.
It is used to get input from a user and store in computer memory with some
name.
It is used to give name to data in computer memory. It is also used to update the
value of existing data.
It is used to check the condition. For example, the condition like if(a<b).
Condition is evaluated as true or false. In case the condition is true then the
statements related with if part are executed otherwise the statements of else part
are executed. Usage: Suppose a=5 and b=7, if(a<5) Set c to 10 else Set c to
20.Writing else part is optional.
It is used to transfer control to a certain step of an algorithm. It is usually
required in loops.
It is used to display values.
It is the termination point of an algorithm.
Input
Set
if, else
Goto
Output
Stop
Examples of Algorithms
1. To find the area of a parallelogram.
Step 1. Start
Step 2. Input numbers, base, height
Step 3. Set area to base x height
Step 4. Output area
Step 5. End
2. To display the larger one out of the three given numbers.
Step 1. Start
Step 2. Input three numbers, a, b, c
Step 3. Set large to a
Step 4. If b > large Set large to b
Step 5. If c > large Set large to c
Step 6. Output large
Step 7. End
3. To assign grade to a subject based on the achieved marks.
Step 1. Start
Step 2. Input numbers obtained marks, total marks
* 100
obtained, marks
Step 3. Set percentage to
total, marks
Step 4. if percentage > 80 Set grade to A+
else
if percentage > 70 Set grade to A
else
if percentage > 60 Set grade to B
else
if percentage > 50 Set grade to C
else
if percentage > 40 Set grade to D
[PAGE: 1
_6
_0F
_18
]
M
^ITE: [EMAIL: FREEILM7860GMAIL.C0M1
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1
else
if percentage > 33 Set grade to E
else
Set grade to F
Step 5. Output grade
Step 6. End
4. To find the interest on an amount
Step 1. Start
Step 2. Input numbers, amount, rate, years
Step 3. Set plain interest to ( amount x ) x years
Step 4. Output plain interest
Step 5. End
5. To convert Celsius (Centigrade) to Fahrenheit temperature and vice versa.
Step 1. Start
Step 2. Input number. Celsius
Step 3. Set Fahrenheit to
Step 4. Output Fahrenheit
Step 5. Input number, Fahrenheit
Step 6. Set Celsius to (Fahrenheit - 32) x
|
Step 7. Output Celsius
Step 8. End
Celsius x9
+ 32
5
6. Find even numbers in integers ranging from nl to n2 (where n2 is greater than nl).
Step 1 Start
Step 2 Input numbers, nl, n2
Step 3 if (nl < n2) {
Step 4 if (nl mod 2 equal 0) output nl
Step 5
Step 6. goto step 3
Set nl to nl + 1
}
Step 7. End
Q.17 Write down advantages and disadvantages of flowchart and algorithm
Ans:
Advantages of Flowchart
• With the help of a flowchart, the logic of an algorithm can be described more
effectively.
• The flowchart helps in debugging process.
• Easy to draw.
• Easy to understand problem solving.
• Easy to observe flow from one step to the other.
M
^ITE: [PAGE: 17
_0
F
_lg
]
[EMAIL: FREEILM786flGMAIL.COM
!
[WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS
!
Disadvantages of a Flowchart
• It is difficult to draw flowcharts for complex and large problems.
• More time is required to draw a flowchart.
• Modifying a flowchart is not very easy every time.
Advantages of an Algorithm
• To solve a large problem, algorithms are helpful.
• Easy to write.
• Techniques to write an algorithm are easy to understand.
Disadvantages of an Algorithm
• Showing the flow from one step to the other is not very easy.
• Modifying an existing algorithm is not very easy every time.
• Usage of goto makes it difficult to identify errors.
Q.18 Explain Verification and Validation with help of examples.
Ans:
Verification: Verification means to test ifthe solution is actually solvingthe same problem for
which it was designed.
Example: If you are asked to give a solution for calculating compound interestthen verification
means to know that it is giving results for compound interest not for the plain interest.
Validation: Validation means to test whether the solution is correct or not.
Example 1: If you are asked to give a solution for calculating compound interest then
validation means to know whether it is finding the correct compound interest or not. If a
solution is verified, then it is validated with the help of test data.
Example 2: Let's assume that you go to a pizza shop and order a chicken pizza. You state your
requirement that it should be less spicy. You also expect that it would taste good. When the
pizza arrives, you can observe that it is a chicken pizza. This is called verification. Now, when
you eat the pizza, you can check whether it is less spice or not, it tastes good or not. This is
called validation.
Example 3: Let's assume that you are asked to write an algorithm that takes as input a list of
numbers. The algorithm should display the list arranged in ascending order. After writing the
algorithm you submit it to your teacher. Your teacher provides a list of numbers to the
algorithm.
If your algorithm displays a list of numbers then it is verified. Instead if your algorithm displays
an answer is yes or no, or displays something else, then it is not verified. If your algorithm is
verified, your teacher moves to the next step of validation. He checks whether the list of
numbers displayed are actually in ascending order or not. If the list is in ascending order and
no element is missing then your solution is also validated.
|Report any mistake ?|
at : freeilni786@gmail.com
visit: freeilm.com
[WEBSITE: WWW.FREEILM.C0M1 [PAGE: 13 OF 1
*1
[EMAIL: FREEILM7860GMAIL.C0M1

More Related Content

Similar to 9th Comp Ch 1 LQ.pdf

UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
SamridhiGulati4
 
Introduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.pptIntroduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.ppt
BhargaviDalal4
 
Cse115 lecture03problemsolving
Cse115 lecture03problemsolvingCse115 lecture03problemsolving
Cse115 lecture03problemsolving
Md. Ashikur Rahman
 
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptx
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptxChallenges-and-Consideration-in-Programming-Logic-and-Design...pptx
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptx
RusherGamer1
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
Prof. Dr. K. Adisesha
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
Saurabh846965
 
Mb0048 operations research
Mb0048  operations researchMb0048  operations research
Mb0048 operations researchsmumbahelp
 
Algorithm types performance steps working
Algorithm types performance steps workingAlgorithm types performance steps working
Algorithm types performance steps working
Saurabh846965
 
PPS_Unit 1.pptx
PPS_Unit 1.pptxPPS_Unit 1.pptx
PPS_Unit 1.pptx
KundanBhatkar
 
Lesson 3
Lesson 3Lesson 3
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
Hamad Odhabi
 
AOA Week 01.ppt
AOA Week 01.pptAOA Week 01.ppt
AOA Week 01.ppt
INAM352782
 
2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf
ishan743441
 
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docxCase Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
wendolynhalbert
 
Unit 1 python (2021 r)
Unit 1 python (2021 r)Unit 1 python (2021 r)
Unit 1 python (2021 r)
praveena p
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithm
JIMS LAJPAT NAGAR
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
MIT,Imphal
 
Csc 102 lecture note(introduction to problem solving)
Csc 102 lecture note(introduction to problem solving)Csc 102 lecture note(introduction to problem solving)
Csc 102 lecture note(introduction to problem solving)
Christopher Chizoba
 
Algorithm and C code related to data structure
Algorithm and C code related to data structureAlgorithm and C code related to data structure
Algorithm and C code related to data structure
Self-Employed
 
problem-solving.pptx
problem-solving.pptxproblem-solving.pptx
problem-solving.pptx
hadi261715
 

Similar to 9th Comp Ch 1 LQ.pdf (20)

UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
 
Introduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.pptIntroduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.ppt
 
Cse115 lecture03problemsolving
Cse115 lecture03problemsolvingCse115 lecture03problemsolving
Cse115 lecture03problemsolving
 
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptx
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptxChallenges-and-Consideration-in-Programming-Logic-and-Design...pptx
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptx
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
 
Mb0048 operations research
Mb0048  operations researchMb0048  operations research
Mb0048 operations research
 
Algorithm types performance steps working
Algorithm types performance steps workingAlgorithm types performance steps working
Algorithm types performance steps working
 
PPS_Unit 1.pptx
PPS_Unit 1.pptxPPS_Unit 1.pptx
PPS_Unit 1.pptx
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
 
AOA Week 01.ppt
AOA Week 01.pptAOA Week 01.ppt
AOA Week 01.ppt
 
2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf
 
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docxCase Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
Case Study Analysis 2The Cholesterol.xls records cholesterol lev.docx
 
Unit 1 python (2021 r)
Unit 1 python (2021 r)Unit 1 python (2021 r)
Unit 1 python (2021 r)
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithm
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
 
Csc 102 lecture note(introduction to problem solving)
Csc 102 lecture note(introduction to problem solving)Csc 102 lecture note(introduction to problem solving)
Csc 102 lecture note(introduction to problem solving)
 
Algorithm and C code related to data structure
Algorithm and C code related to data structureAlgorithm and C code related to data structure
Algorithm and C code related to data structure
 
problem-solving.pptx
problem-solving.pptxproblem-solving.pptx
problem-solving.pptx
 

Recently uploaded

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 

Recently uploaded (20)

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 

9th Comp Ch 1 LQ.pdf

  • 1. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS ! Iriit 1: Problem Solvin; ^HLongQuestions ^l g Q.l Define problem analysis. Explain your answer along with an example. Ans: The process of understanding the problem for developing its solution is called analyzing the problem. It is important to understand the problem before jumping into the solution of the problem, Identification of the 5 Ws: Understanding of a problem usually includes identification of the 5 Ws (what, who, when, where, and why). Problem analysis is the process to figure out these 5 Ws from a problem statement. Example 1: Suppose your class teacher assigns you a task to prepare a list of students in your directory of all school students and there is only one week to complete the task school whose names start with letter 'A'. The list is required in order to prepare an alphabetical directory of all school sudents and there is only one week to complete the task. We can analyze this problem by identifying 5Ws in the problem statement as given below: • What: List of students names starting with letter 'A': • Who: Students. • Why: To prepare the directory of students. • When: Within a week. • Where: School Example 2: Suppose you prepare a list oftop 10% students in computer science subject in your class within a week. We can analyze this problem by identifying 5Ws in the problem statement as given below: • What: A list of top 10% students in computer science subject in your class. • Who: Students. • Why: To prepare the list of top 10% students in computer. • When: Within a week. • Where: School Q.2 Define an algorithm and argue on its role and importance in problem solving. Ans: An algorithm is a finite set of steps, which, if followed, accomplish a particular task. It is written in a natural language, so it is easily understandable by humans. Usually an algorithm takes an input and then after processing produces some output. Role of Algorithms in Problem Solving • Formulating an algorithm is the first step for developing a computer program. [PAGE: 1 OF 181 [WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
  • 2. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1 • An algorithm has a vital role in problem solving as it provides a step-by-step guide to the problem solver. • It is a complete description of the solution. • A computer programmer first writes an algorithm and then translates it into the code of some programming language. Importance of Algorithms in Problem Solving • To solve a large problem, algorithms are helpful. • Easy to write. • Techniques to write an algorithm are easy to understand. Example 1: For example, to solve the problem of preparing tea, we can follow the following steps: Step 1: Start Step 2: Take a kettle Step 3: Pour water in it Step 4: Put the kettle on fire Step 5: Add sugar, milk and tea Step 6: Wait till it boils Step 7: Remove the kettle from fire Step 8: End Example 2: To find the sum, product and average of five given numbers. Step 1. Start Step 2. Input numbers, a, b, c, d, e Step 3. Set sum toa + b + c + d + e Step 4. Set product t o a x b x c x d x e Step 5. Set average to (a + b + c + d +e ) / 5 Step 6. Output sum, product, average Step 7. End Example 3: To find acceleration of a moving object with given mass and the applied force. Step 1. Start Step 2. Input numbers, mass, force Step 3. Set acceleration to force/ mass Step 4. Output acceleration Step 5. End Example 4: To find the volume of a cube. Step 1. Start Step 2. Input number, side Step 3. Set volume to side x side x side Step 4. Output volume Step 5. End [PAGE: I OF 181 [EMAIL: FREEILM786 @ GMAIL.C0M1
  • 3. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS ! Q.3 Suppose a problem has multiple algorithms. How would you choose the most efficient one? Explain with example. Ans: There can be more than one algorithms to solve the same problem. Which one is better, depends upon the efficiency ofthe available solution algorithms. Efficiency of an algorithm is measured on the basis of two metrics: 1. Number of steps: An algorithm is considered more efficient if it takes less number of steps to reach the results. 2. Space used in computer memory: We have observed in algorithms that some data is stored in computer memory which is later used to give results. An algorithm using less space in computer memory is considered more efficient with respect to memory space. It is quite possible that one algorithmtakes less space in memory and has more number of steps whereas the other algorithm takes more memory and has less number of steps. Inthis case there is a trade-off between number of steps and the consumed memory. The designer can take decision according to the requirements. Example Let's suppose we have two algorithms to solve a certain problem. One algorithm has N steps whereas the other algorithm has N2 steps. In this case the first one is considered more efficient than the first one. Example We need to compute the following. 1 +2 +3 +4 +5 + ... + 99 How can we find its answer? Different minds can find different solutions to solve this problem. 1. One solution is to start adding numbers from beginning and keep adding till the end. 2. Other solution is to start making pairs as (1 +99), (2 +98), (3 +97), (4 + 96), (5 +95) ... (49+51) where each pair gives answer 100. We count the number of pairs and multiply that count with 100 and then in the result we add 50 as it is nowhere in any pair. 3. Another solution is to use formula n(n+V where n is the last term. So, the solution is just to 99 (99+1) solve These examples shows different approaches to solve one problem and if these approaches are used in computer then accordingly there may be different memory usage and number of steps. Third step is better because it use less number of stepsto reach the result and also consume less space in computer memory. 2 Q.4 How do you determine requirements for a flowchart? OR Write steps for drawing a flowchart. Ans: Flowchart is the graphical or visual representation of an algorithm to solve problem using symbols. The flowchart developer must determine the following requirements for the given problem or algorithm before drawing a flowchart: • Input to the flowchart • Type of processing required PAGEt 3 OF 181 [WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
  • 4. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS ! • Decisions to be taken • The output to be produced after processing 1. Input: The flowchart developer must know about the input for flowchart. Example: If the giver problem is to find area of rectangle. Here inputs will be length and width 2. Processing: The flowchart developer must decide whattype of calculation is to be performed or which formula is to be applied to obtain the required result Example: To the find the area of rectangle, the following formula is to be used Area = Length * Width 3. Decision: The flowchart developer must decide which control structures (sequence, repetition or selection) are to be applied for the solution of the problem. Example: To find the largest number from any three given numbers... 4. Output: The flowchart must be provide the required output. Q.5 What is test data? Describe types of test data. Ans: Test data is used to test whether the solution of the problem is correct or not. After solving a problem, we need to test whether the solution is correct or not, and for testing, we need "Test Data". Importance of Testing • Testing is essential to point out the defects and errors made during finding a solution to some problem. • It helps in improving a solution. If one solves a problem and someone else uses that solution for commercial purposes, then the commercial activities depend upon the correctness of that solution. Example 1: if we develop a solution for finance management and some bank starts using it then any error in that solution may result in a financial loss. So, testing is important for a solution. Example 2: A car is delivered to a customer after testing. Upon launching a new car, it is usually tested with a robot driver who hits the car with a wall. It is used to test whether the air bags and other security systems are functioning or not. Moreover, it also allows the car designers to suggest further security measures to reduce the damage. This test can help to make a car safe. So testing helps to improve quality. Types of Test Data Following are the types of test data. Valid test data: It is data that is valid with the input requirement of the algorithm. Example: If an algorithm is supposed to take a numeric value between 1 and 50 as input, then any value between 1 and 50 is a valid test data. Invalid test data: It is data that is invalid with the input requirement of the algorithm. Example: If an algorithm is supposed to take a numeric value between 1 and 50 as input, but that input is not between 1 to 50 so it is invalid test data. Boundary test data values: A solution is tested on extreme values. Example: To calculate interest we can consider principal amount as 0 or a very huge amount. Absent data: It is also important to investigate that the solution still works if less number of inputs are given than expected. [PAGE; 4 OF 181 [WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
  • 5. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS ! Example: If a system asks to enter driving license number, then everyone cannot provide this information. It is important to see how the system reacts in such situations. Wrong data formats: It is wise to check how the system reacts on entering data in wrong format. Example: Giving a numeric value as input when alphabet is expected. Q.6 Describe identification and correction of errors using a trace table. Ans: If an algorithm is failed during verification, then it is important to identify the root cause of failure and then to correct it. Sometimes the error is logical. It means the solution is working but not giving required results. For example, to recruit students for our school volleyball team, we need students having height between 144 cm and 164 cm. To count qualified students, we develop the following algorithm. Step 1. Start Step 2. Set count to 0 Step 3. Set all heights to [154, 140, 155, 164, 144, 166, 160, 143] Step 4. For each height in the list all-heights Step 5. If height > 144 and height < 164 then set count to count + 1 Step 6. Output count Step 7. Stop The above algorithm works but does not count all students. There is a deliberate error on Step 5. The symbol > has been used instead of > before the number 144. So, the students having height 144cm will not be counted. This is a logical error. We can identify this type of errors using a trace table. Trace table: A trace table is a technique used to test algorithms, in order to make sure that no logical errors occur while the algorithm is being processed. The table usually takes the form of a multi- column, multi-row table; with each column showing names of data, and each row showing values of the data at each step. Example: To recruit students for our school basketball team, we need students having height between 144 cm and 164 cm. Table shows a trace table for the algorithm. The blank means there is no change and —means that a value is not concerned. In the following table Step 1 has no effect on data. Step 2 is assigning 0 to count and in Step 3, list all heights is introduced. In Step 4, there is no change in both count and all heights but the data 154 is stored in height. It is compared in Step 5 and the value in count is updated if data is in given range. Steps 4 and 5 are repeated for each value as shown in Table. Count All heights height Step 1 Step 2 0 Step 3 [154, 140, 155, 164, 144, 166, 160, 143] Step 4 154 Step 5 1 PAGEt m OF 181 [WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
  • 6. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1 Step 4 140 Step 5 1 Step 4 155 Step 5 2 Step 4 164 Step 5 3 Step 4 144 Step 5 3 Step 4 166 Step 5 3 Step 4 160 Step 5 4 Step 4 143 Step 5 4 Step 6 Step 7 Q.7 What do you mean by problem solving? Describe the problem solving process. Ans: Problem: A problem is an obstacle, hurdle, difficulty or challenge, or any situation that needs to be removed or solved. Problem solving: Problem - solving is a skill which can be developed by following a well- organized approach. Programming is also a problem solving activity. Solving problems is the main task of computer science which is the job of computer programmer. Programmer must first understand how a human solves a problem then translate it into a set of instructions in a programming language that a computer can understand and execute. The following five Steps involved in problem solving process. 1. Defining a Problem 2. Understanding a Problem. 3. Planning a Solution. 4. Defining Candid Solutions. 5. Selecting the Best Solution 1. Defining the Problem Defining the problems is initial stage of problem solving. A well-defined problem is the one that does not contain any ambiguities. All the conditions are clearly specified and a clear goal. When we are going to solve some problem first we need to see whether the problem is defined well or not. If the problem is not defined well first of all define the problem. If the problem is not defined well then we can use one of the following strategies to define the problem. Strategies to define the problem. • Gain Background Knowledge [PAGE: 6 OF 181 [EMAIL: FREEILM786 @ GMAIL.C0M1
  • 7. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS ! We try to know the situation and circumstances in which the problem is happening. In this way, we can identify the given state. It also helps to know what' a good solution will look like. How we shall be able to measure the solution • Use Guesses We try to guess the unknown information through appropriate guesses. These guesses may be based upon our past experiences. • Draw a Picture If the problem is not well-defined, we can draw a picture and fill the undefined information. 2. Understanding a problem The process of understanding the problem for developing its solution is called analyzing the problem. It is important to understand the problem before jumping into the solution of the problem. Understanding of a problem usually includes identification of the 5 Ws (what, who, when, where, and why). Example 1: Suppose your class teacher assigns you a task to prepare a list of students in your school whose names start with letter 'A'. The list is required in order to prepare an alphabetical directory of all school students and there is only one week to complete the task. We can analyze this problem by identifying 5Ws in the problem statement as given below: • What: List of students names starting with letter 'A'. • Who: Students. • Why: To prepare the directory of students. • When: Within a week. • Where: School 3. Planning the solution of the problem Planning the solution of the problem is a creative stage of problem solving. It refers to dividing the solution into steps and arranging them into proper order that will solve the problem. Strategies for Planning a Solution Following are the strategies that depend upon the nature of problem: • Divide and Conquer: This strategy divides a complex problem into smaller problems. • Guess, Check and Improve: The designer guesses a solution to a problem and then checks the correctness of the solution. If the solution is not according to expectations, then he/she refines the solution. • Act it Out: In this strategy the designer defines the list of "to-do" tasks. Afterwards he/she performs the task • Prototype (Draw): This technique draws a pictorial representation of the solution. It is not the final solution. However, it may help a designer to understand the important components of the solution. 4. Candid solutions of a problem All the possible solutions of a problem that produce correct result are known as candid solutions. The word candid refers to something spontaneous and unplanned. One can think of a candid solution anytime. A candid solution can help to save time. It is not necessary that the candid solution is the actual solution of a problem. [PAGE: H OF 181 [WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
  • 8. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS ! 5. Select the best solution After defining the candid solutions, only one solution can be selected. The selection of final solution of a problem should be based on the following criteria. Speed: The selected solution of the problem should be efficient Cost: The selected solution of the problem should provide a cost-effective way of implementation. Complexity: The selected solution ofthe problem should not be complicated. It should contain minimum number of instructions/simple steps. Q.8 Explain Candid Solutions with example. Ans: The word candid refers to something spontaneous and unplanned. All the possible solutions of a problem that produce estimated result are known as candid solutions. To find candid solutions of a problem, programmer has to look for different methods to solve the problem and come up with several solutions. A candid solution can help to save time It is not necessarythat the candid solution is actual solution of problem. Example: If you are asked to find number of students in your school who can play football. You can estimate by finding football players in your class and then multiplying it by the total number of classes in your school. Your answer inthis way is the candid solution. To find exact number of football players, you have to choose some other way, like visiting each class or getting data from teachers. Q.9 What are importance of flow chart in solving a problem? Describe symbols that are used in flowcharting. Ans: Flowchart: Flowchart is the graphical or visual representation of an algorithm to solve problem using symbols. Importance of flow chart in solving a problem • With the help of a flowchart, the logic of an algorithm can be described more effectively. • Flowchart illustrates the sequence of operations to be performed to solve a problem in the form of a diagram. • Computer programmers draw flowcharts before writing computer programs. It provides an easy way to analyze and find solutions of problems. • Once, the flowchart is drawn, it becomes easy to write program in any high level language. • The flowchart helps in debugging process. Flowchart symbols PAGE; 8 OF 181 [WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786@GMAIL.C0M1
  • 9. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1 Symbol Name Description Flow line this symbol shows the flow of data, information or process in the flowchart. Terminal An oval shape symbol that represents the Start and End of a flowchart. I I A Rectangle shape symbol is used to represent the process or action taken or shows all the calculations. Process Symbol Name Description o Decision A diamond represents a decision symbol used for comparison or a decision. It changes the flow of control and decides a particular path to be followed. CD Input/output A parallelogram represents either input or output operation regardless of the input or output method. O Connector A small circle represents a connector symbol and is used to join various parts of a flow chart. Q. 10 Draw a flowchart to find the sum, product and average of five given numbers. Ans: Start z 7 Input nO, n1, n2, n3, n4 Sum = nO + n1 + n2* n3* n4 Product = nO x n1 x n2 x n3 x n4 Avg = [nO + n1 + n2 + n3 + n4) / 5 z 7 Print Sum, Product, Avg End [PAGE :9 OF 181 [WEBSITE: [EMAIL: FREEILM71 JL.C0M1
  • 10. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1 Q. 11 Draw a flow chart to display the large one out of three given unequal numbers. OR Draw a flowchart to find largest of three numbers. Ans: METHOD 1 Start > r Input nO, n1, n2 i r Large = nO No n1 > Large Yes Large = n1 Yes n2 > Large Large = n2 No 1 r J Print Large 7 Stop METHOD 2 [WEBSITE: WWW.FREEILM.C0M1 [PAGE: 18 OF 181 [EMAIL: FREEILM7868GMAIL.C0M1
  • 11.
  • 12.
  • 13. [ WEBSITE: WWW.FREEILM.COMl [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS! Q.13 Draw a flowchart to determine name of a week day form a given number where weekdays are assumed from Monday to Smiday and their respective numbers from 1 to 7. Ans: Start ’r Input number day Mo Yes y'Piint "Monday Day is 1 Mo Yes WPrint"Tuesday / Day is 2 i r - ^rint 'Wednesday /'’’' Yes Mo Day is 3 v Mo Yes /Print "Thursday / Day is 4 y Print "Friday" / Mo Yes Day is 5 - /Print 'Saturday /'' Mo Yes Day is 6 ' f Yes / / y Print "Sunday"/ Day is 7 1 Mo y y y y y < Stop [PAGE: 13 OF 18l [ WEBSITE: WWW .FREEILM.C0M1 [ EMAIL: FREEILM7860GMAIL .COM!
  • 14. [ WEBSITE: WWW.FREEILM.COMl [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS! Q. 14 Draw a flowchart to input 5 values one by one and determine if the given value is odd or even. Ans: Start 'f count = 0 'f Input number n i r Increase count by 1 i f Rem = n mod 2 Yes Wo Rem is 0 'r Print n is even Print n is odd Wo Count = 5 Yes i r Stop [PAGE: 14 OF 18l [ WEBSITE: WWW .FREEILM.C0M1 [ EMAIL: FREEILM786@GMAIL .C0M1
  • 15. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1 Q. 15 Draw a flowchart to find a sequence of odd numbers starting from a given nmnber till some limit. Ans: Start i r zInput number n, limit Rem = n mod 2 Yes Wo Rem is 0 Increase n by 1 * Yes No n < = limit Stop I Print n Increase n by 2 Q.16 What is algorithm? Explain formulation of algorithm with examples. Ans: An algorithm is a finite set of steps, which, if followed, accomplish a particular task. It is written in a natural language, so it is easily understandable by humans. Usually an algorithm takes an input and then after processing produces some output. Formulation of an Algorithm There are different notations (keywords) to write an algorithm given below in table: [WEBSITE: WWW.FREEILM.C0M1 [EMAIL: FREEILM786 @ GMAIL.C0M1 [PAGE: 15 OF ISl
  • 16. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1 Notation Start Meaning It is the starting point of an algorithm. Every algorithm must have one starting (entry) point. It is used to get input from a user and store in computer memory with some name. It is used to give name to data in computer memory. It is also used to update the value of existing data. It is used to check the condition. For example, the condition like if(a<b). Condition is evaluated as true or false. In case the condition is true then the statements related with if part are executed otherwise the statements of else part are executed. Usage: Suppose a=5 and b=7, if(a<5) Set c to 10 else Set c to 20.Writing else part is optional. It is used to transfer control to a certain step of an algorithm. It is usually required in loops. It is used to display values. It is the termination point of an algorithm. Input Set if, else Goto Output Stop Examples of Algorithms 1. To find the area of a parallelogram. Step 1. Start Step 2. Input numbers, base, height Step 3. Set area to base x height Step 4. Output area Step 5. End 2. To display the larger one out of the three given numbers. Step 1. Start Step 2. Input three numbers, a, b, c Step 3. Set large to a Step 4. If b > large Set large to b Step 5. If c > large Set large to c Step 6. Output large Step 7. End 3. To assign grade to a subject based on the achieved marks. Step 1. Start Step 2. Input numbers obtained marks, total marks * 100 obtained, marks Step 3. Set percentage to total, marks Step 4. if percentage > 80 Set grade to A+ else if percentage > 70 Set grade to A else if percentage > 60 Set grade to B else if percentage > 50 Set grade to C else if percentage > 40 Set grade to D [PAGE: 1 _6 _0F _18 ] M ^ITE: [EMAIL: FREEILM7860GMAIL.C0M1
  • 17. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS1 else if percentage > 33 Set grade to E else Set grade to F Step 5. Output grade Step 6. End 4. To find the interest on an amount Step 1. Start Step 2. Input numbers, amount, rate, years Step 3. Set plain interest to ( amount x ) x years Step 4. Output plain interest Step 5. End 5. To convert Celsius (Centigrade) to Fahrenheit temperature and vice versa. Step 1. Start Step 2. Input number. Celsius Step 3. Set Fahrenheit to Step 4. Output Fahrenheit Step 5. Input number, Fahrenheit Step 6. Set Celsius to (Fahrenheit - 32) x | Step 7. Output Celsius Step 8. End Celsius x9 + 32 5 6. Find even numbers in integers ranging from nl to n2 (where n2 is greater than nl). Step 1 Start Step 2 Input numbers, nl, n2 Step 3 if (nl < n2) { Step 4 if (nl mod 2 equal 0) output nl Step 5 Step 6. goto step 3 Set nl to nl + 1 } Step 7. End Q.17 Write down advantages and disadvantages of flowchart and algorithm Ans: Advantages of Flowchart • With the help of a flowchart, the logic of an algorithm can be described more effectively. • The flowchart helps in debugging process. • Easy to draw. • Easy to understand problem solving. • Easy to observe flow from one step to the other. M ^ITE: [PAGE: 17 _0 F _lg ] [EMAIL: FREEILM786flGMAIL.COM !
  • 18. [WEBSITE: WWW.FREEILM.C0M1 [NOTES: 9TH COMPUTER - UNIT 1 - LONG QUESTIONS ! Disadvantages of a Flowchart • It is difficult to draw flowcharts for complex and large problems. • More time is required to draw a flowchart. • Modifying a flowchart is not very easy every time. Advantages of an Algorithm • To solve a large problem, algorithms are helpful. • Easy to write. • Techniques to write an algorithm are easy to understand. Disadvantages of an Algorithm • Showing the flow from one step to the other is not very easy. • Modifying an existing algorithm is not very easy every time. • Usage of goto makes it difficult to identify errors. Q.18 Explain Verification and Validation with help of examples. Ans: Verification: Verification means to test ifthe solution is actually solvingthe same problem for which it was designed. Example: If you are asked to give a solution for calculating compound interestthen verification means to know that it is giving results for compound interest not for the plain interest. Validation: Validation means to test whether the solution is correct or not. Example 1: If you are asked to give a solution for calculating compound interest then validation means to know whether it is finding the correct compound interest or not. If a solution is verified, then it is validated with the help of test data. Example 2: Let's assume that you go to a pizza shop and order a chicken pizza. You state your requirement that it should be less spicy. You also expect that it would taste good. When the pizza arrives, you can observe that it is a chicken pizza. This is called verification. Now, when you eat the pizza, you can check whether it is less spice or not, it tastes good or not. This is called validation. Example 3: Let's assume that you are asked to write an algorithm that takes as input a list of numbers. The algorithm should display the list arranged in ascending order. After writing the algorithm you submit it to your teacher. Your teacher provides a list of numbers to the algorithm. If your algorithm displays a list of numbers then it is verified. Instead if your algorithm displays an answer is yes or no, or displays something else, then it is not verified. If your algorithm is verified, your teacher moves to the next step of validation. He checks whether the list of numbers displayed are actually in ascending order or not. If the list is in ascending order and no element is missing then your solution is also validated. |Report any mistake ?| at : freeilni786@gmail.com visit: freeilm.com [WEBSITE: WWW.FREEILM.C0M1 [PAGE: 13 OF 1 *1 [EMAIL: FREEILM7860GMAIL.C0M1