Algorithm and Flowchart
1. Write an algorithm to display the marks of two subjects and find sum and average.
=
Step 1:- Start.
Step 2:- Accept the first subject mark input a.
Step 3:- Accept the second subject mark input b.
Step 4:- c=a + b.
Step 5:- d=c/2
Step 6:- Print c and d.
Step 7:- Stop.
2. Write an algorithm to input a side of a square and calculate its area and perimeter.
=
Step 1:- Start.
Step 2:- Accept the side of a square input a.
Step 3:- b=a*a.
Step 4:- c=4*a.
Step 5:- Print b and c.
Step 6:- Stop.
3. What is an algorithm?
= An algorithm is a logical step-by-step process for solving a problem. It is a defined set of instructions used to achieve a desired output.
4. Why do we need an algorithm?
= We need an algorithm in all aspect of daily life as they precisely state the steps to be taken to solve a problem or to reach a goal.
5. Write the advantages of algorithm.
= The advantages of an algorithm are as follows -
i) It helps to decide to strategy.
ii) It provides useful references.
iii) It can be transformed to computer language.
iv) It is an easy path for making any decision.
v) It is easy to debug.
6. Write the limitations of an algorithm.
= The limitations of an algorithm are -
i) There is no proper syntax for writing it.
ii) It has no standard representation.
7. What is debugging ?
= Debugging the process of rectifying an error from a certain program or file and removing it.
8. Write an algorithm to display the sum of 3 and 5.
=
Step 1:- Start.
Step 2:- Accept the first number, a=3.
Step 3:- Accept the second number, b=5.
Step 4:- c=a + b.
Step 5:- Print c.
Step 6:- Stop.
9. What do you mean by flowchart?
= A flowchart is a graphical representation of an algorithm and is helpful in understanding the logic of complicated and lengthy problems.
10. Write any five rules for writing flowcharts.
= Five rules for writing flowcharts are -
i) In a flowchart, steps should be expressed in logical order.
ii) It should be clear, neat and easy to follow.
iii) It should have a logical start and end.
iv) Only one flow line should come out from a process symbol.
v) Only one flow line should be used in conjunction with start/stop symbol.
11. Differentiate flowchart and algorithm.
=
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
12. Write four advantages of flowcharts.
= Four advantages of flowcharts are -
i) It is used for initial planning of a problem.
ii) It makes easy programming.
iii) Once flowchart is drawn, the program can be written in any high-level language.
iv) It enables systematic testing and debugging.
13. What are the limitations of flowchart.
= The following are the limitations of flowchart -
i) There is no standardised rule for its representation.
ii) It is time consuming.
14. Name the standard symbols used in flowcharts and describe them.
= The following are the standard symbols used in flowcharts -
i) Start/Stop:- An ellipse is used to indicate the start and stop of a program. It is also called terminal box.
ii) Input/Output:- A parallelogram is used to accept the input and display the output.
iii) Process:- A rectangle shows the processing taking place in the flowchart.
iv) Decision/Test condition:- A diamond has two branches to show the decision in a flowchart. Condition is specified in the diamond.
v) Flow lines:- Arrows show the flow of steps in flowcharts.
vi) Connectors:- Circles connects two parts of the flowchart.
15. Draw a flowchart to find the sum of two numbers to be entered by users.
=
16. Draw a flowchart and convert Celsius temperature into Fahrenheit scale.
=
17. Draw a flowchart and explain the steps to interchange the values of two variables by using a third variable.
=
18. Draw a flowchart to input two variables and interchange their values without using a third variable.
=
19. Draw a flowchart to display whether the number entered by user is positive or negative.
=