Professional Documents
Culture Documents
LBEPS Session 16
LBEPS Session 16
Problem Solving
Objectives
Solution:
The following Word document shows the solution.
Exercise 1
3.4 Let’s Practice (Contd.)
Solution:
begin
numeric nHrs, nResources, nPrdHrs
accept nHrs
accept nResources
compute nPrdHrs = nHrs * nResources
display ‘The total productive hours is ‘ + nPrdHrs
end
3.4 Let’s Practice (Contd.)
Solution:
The following Word document shows the solution.
Exercise 3
3.4 Let’s Practice (Contd.)
Exercise 4
Implementing Iterative
Processes
Syntax
The following Word document shows the flowchart to display the sum
of 10 numbers.
Sum of 10
Numbers
The for Loop (Contd.)
begin
numeric nNum, nSum, nCounter
nCounter = 0, nSum = 0
for(nCounter = 0;nCounter < 10;nCounter = nCounter +
1)
begin
accept nNum
nSum = nSum + nNum
end
display nSum
end
Just a Minute
Solution:
1. three
The while loop
Syntax
Selection
Flowchart
Selection
Pseudocode
4.1 Let’s Practice
Solution:
The following Word document shows the flowchart to display the sum
of the first 10 odd numbers.
Exercise 1
Flowchart
The following Word document shows the pseudocode to display the
sum of the first 10 odd numbers.
Excercise 1
Pseudocode
Summary