Q1. (a) Below is given an algorithm with deliberate error.
Find
the line number where the error is present. And suggest the
correction for that error as well.
1. Set total to 0
2. Loop these commands 10 times
3. Add number to total to give the new total
4. Input answer
5. Output total
Line number: 3/4
Correction: 3/4 lines will be swap
(b) State the difference between algorithm and program.
A program is a set of instructions that the computer executes to
perform a specific task, solve a problem or achieve a specific goal.
The step by step problem solving technique is called Algorithm.
(c) Why we use Algorithms?
Because algorithms help us find the best way to do something,
step by step. We can get the result quickly and without mistakes.
Q2. A scratch program for sum of 15 numbers and their average
calculation is given below.
Fill in blank spaces with the word list given.
More than one blank can have the same word.
Word total 0 15
List:
average 10 counter
answer 10 counter +
1
Total +
Answer
Total
15
Average
Q3. Four lines of algorithms are shown on the left and five block of
scratch programming are show on the right side.
By drawing lines, connect each line to the correct block of scratch.
Loop until Y is entered
Subtract the input from
Set total to 100
Add 1 to the counter