Chapter | 15 Programming Tools: Algorithm and Flowchart

 

3. Very Short Question.

a) An algorithm is programming language or programming tool?

Ans: An algorithm is not a programming language or a programming tool. It is a step-by-step procedure to solve a problem.

b) Does flowchart help to find and correct the mistakes in the program?

Ans: Yes, a flowchart helps to find and correct mistakes because it shows the logical flow of the program clearly.

c) How can you begin and terminate an algorithm?

Ans: An algorithm begins with Start and terminates with  Stop/End.

d) Which symbol is used to join flowchart of different pages?

Ans: The Connector symbol (off-page connector) is used to join flowcharts of different pages.

e) Can you write simple program without writing an algorithm and flowchart?

Ans: Yes, we can write a simple program without writing an algorithm or flowchart, but it may increase the chances of errors.

4. Short Question.

a. What is a computer program?

Ans: A computer program is a set of instructions written in a programming language that tells a computer how to perform a specific task.

b. Why is preplanning needed to write program instructions?

Ans: Preplanning helps organize ideas, reduce errors, save time, and ensure the program solves the problem correctly before actual coding begins.

c. What are the commonly used programming tools?

Ans: Commonly used programming tools are Algorithm, Flowchart, Pseudocode.

d. What is an algorithm? Write its importance in the programming.

Ans:  An algorithm is a step-by-step procedure to solve a problem.

Importance:

  1. ·        Provides clear solution steps
  2. ·        Makes coding easier
  3. ·        Reduces errors
  4. ·        Saves development time

e. What is a flowchart? What is its use in the programming?

Ans: A flowchart is a graphical representation of an algorithm using symbols.

Use:

  1. ·        Shows program logic clearly
  2. ·        Helps detect errors
  3. ·        Improves understanding of the program

f. Draw different flowchart symbols used in the flowchart and also write their meaning.

Ans: Different flowchart symbols and their meanings:

  1. ·        Oval (Terminator) – Represents Start/End
  2. ·        Rectangle (Process) – Represents Calculation/Instruction
  3. ·        Parallelogram (Input/Output) – Represents Input or Output operation
  4. ·        Diamond (Decision) – Represents Condition/Decision making
  5. ·        Arrow (Flow line) – Shows the direction of flow
  6. ·        Circle (Connector) – Connects different parts of the flowchart**

7. Write Algorithm of:

a. to prepare a cup of tea.

1.     Start

2.     Boil water in a kettle.

3.     Add tea leaves/tea bag into a cup.

4.     Pour boiled water into the cup.

5.     Add sugar and milk as required.

6.     Stir well.

7.     Serve tea.

8.     Stop

b. to print larger of two numbers.

1.     Start

2.     Input number1 and number2

3.     If number1 > number2, print number1

4.     Else print number2

5.     Stop

c. to check if the student has passed or failed assuming pass mark 40.

1.     Start

2.     Input marks

3.     If marks ≥ 40, print "Pass"

4.     Else print "Fail"

5.     Stop

d. to calculate the area of a rectangular box.

  1. 1.     Start
  2. 2.     Input length and breadth
  3. 3.     Area = length × breadth
  4. 4.     Print Area
  5. 5.     Stop

e. to calculate the area of a square.

1.     Start

2.     Input side

3.     Area = side × side

4.     Print Area

5.     Stop

f. to input two numbers and calculate their sum.

1.     Start

2.     Input number1 and number2

3.     Sum = number1 + number2

4.     Print Sum

5.     Stop

g. to check whether the entered number is odd or even.

1.     Start

2.     Input number

3.     If number mod 2 = 0, print "Even"

4.     Else print "Odd"

5.     Stop

h. to input and display the name, address and telephone number of any two students.

1.     Start

2.     Input name1, address1, telephone1

3.     Input name2, address2, telephone2

4.     Display name1, address1, telephone1

5.     Display name2, address2, telephone2

Stop


Post a Comment

0 Comments