0% found this document useful (0 votes)
2 views

Computer

The document outlines an algorithm with an error in line 3, which should be corrected by swapping lines 3 and 4. It also explains the difference between an algorithm and a program, stating that algorithms are step-by-step problem-solving techniques while programs are sets of instructions executed by a computer. Additionally, it discusses the importance of algorithms in finding efficient solutions and provides a scratch programming exercise for calculating the sum and average of numbers.

Uploaded by

bushrakram
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Computer

The document outlines an algorithm with an error in line 3, which should be corrected by swapping lines 3 and 4. It also explains the difference between an algorithm and a program, stating that algorithms are step-by-step problem-solving techniques while programs are sets of instructions executed by a computer. Additionally, it discusses the importance of algorithms in finding efficient solutions and provides a scratch programming exercise for calculating the sum and average of numbers.

Uploaded by

bushrakram
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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

You might also like