Programming Techniques Chapter No.1
Extensive Questions
Q.No1 Describe the steps involved in problem solving.
Ans: There are
five steps involved in problem solving these are:
1. Defining the Problem.
2. Analyzing the Problem.
3. Planning the solution of the problem.
4. Candid solutions of a problem.
5. Select the best solution.
Defining the
Problem:
It is the initial stage of problem solving. It is important it understand
the problem before starting the work. The steps to define are:
a. Carefully read the problem and understand
what it tells.
b. Find out what the problem asks.
c. What information can be obtained from the
problem?
d. What is required to be calculated as a
solution.
Analyzing
the Problem:
Here the programmer investigates the problem and gathers the information
to find the solution. The following questions are to be asked:
i.
Is it
possible to solve the problem on the computer?
ii.
What is
to be done to find the solution of the problem?
iii.
What is
the proper sequence of steps to solve the problem?
iv.
What are
the inputs and what output is required?
v.
How many
solutions are possible?
vi.
Which
solution is the best and why?
vii.
How
solution will be implemented?
Planning the Solution of the Problem
Planning is the creative stage, it refers to divide the solution into
steps and arranging them into proper order that will solve the problem.
Candid Solutions of a problem:
To find the candid solution the programmer has to look for different
methods to solve the problem and come up with several solutions.
Select the best Solution:
After finding 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 should be efficient, the program should run fast.
Cost:
The solution should provide
cost-effective way of implementation.
Complexity:
The selected solution should not be
complicated. It should contains minimum number of instructions.
➤➤➤➤➤➤➤➤➤➤➤
Q.No2 Write an algorithm to calculate the area of a rectangle for given breadth and length?
Ans: Algorithm
to find the Area of a rectangle
Step
1: Start
Let L be the given length and B be the given
breadth
Step 2:
Area of a rectangle = L x B
Step 3:
PRINT Area of rectangle
Step 4:
Stop
➤➤➤➤➤➤➤➤➤➤➤
Q.No.3 Write an
algorithm that inputs length in inches and calculates and prints it in centimeter?
Ans: Algorithm to find the product of given
numbers
Step
1: Start
Let l = length in inches
Step 2:
length in cm = l * 2.54
Step 3:
PRINT length in cm
Step 4:
Stop
Q.No.4 Write an algorithm that inputs marks and prints the message “PASS” Or “FAIL” passing marks are 33.
Ans: Algorithm
to find the message PASS or FAIL
Step
1: Start
Let m = marks
Step 2:
if m > = 33 GOTO step 3
otherwise GOTO step 4
Step 3:
PRINT “PASS” GOTO step 5
Step 4:
PRINT “FAIL”
Step 5:
Stop
➤➤➤➤➤➤➤➤➤➤➤
Q.No.5 Write an algorithm to find the sum of given
sequence.
SUM
= 20+25+30+35+40+45+50+55+60
Ans: Algorithm to find the sum of given
numbers
Step
1: Start
Let sum = 20
Step 2:
sum = sum + 5
Step 3: if
sum < 360 then GOTO
step 2 otherwise GOTO
step 4
Step 4:
Output
Step 5: Output
Step 6:
Stop
➤➤➤➤➤➤➤➤➤➤➤
Q.No.6 Write an algorithm to find the product of given numbers. PRODUCT = 1x3x5x7x9x11x13x15
Ans: Algorithm to find the product of given numbers
Step
1: Start
Let product = 1 and increment = 1
Step 2:
increment = increment + 2
Step 3: Product
= product * increment
Step 4: if
product < 2027025 then GOTO
step 3 otherwise GOTO step
5
Step 5: Output
Step 6: Stop
➤➤➤➤➤➤➤➤➤➤➤
Q.No.7 Write an
algorithm to print multiplication table of a number in reverse order.
Ans: Algorithm
to find multiplication table
Step
1: Start
Let num be
the number of multiplication table
i
be the limit of table
Step 2: Let Product = num * i
Step 3: Print
Product
Step 4: i = i – 1
if i = 0 GOTO step 5
else GOTO step 2
Step 5: Output
Step 6: Stop
➤➤➤➤➤➤➤➤➤➤➤
Note: Must Subscribe to get the latest copies of fbise notes,computer science mcqs, computer science 9th class notes, computer science notes for class 10, board papers and much more.
Fbise Notes-Computer | Programming Techniques Long Questiions
Reviewed by fbisenotes
on
July 20, 2019
Rating:
Exellent work
ReplyDelete