Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

algorithm

The document outlines the purpose of algorithms and flowcharts, emphasizing their roles in problem-solving and process organization. It includes specific questions and answers about the significance of flowchart symbols, the use of loops, and provides examples of flowchart symbols for various operations. Additionally, it differentiates between algorithms and flowcharts, lists rules for writing algorithms, and presents an algorithm for calculating the square and cube of a number.

Uploaded by

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

algorithm

The document outlines the purpose of algorithms and flowcharts, emphasizing their roles in problem-solving and process organization. It includes specific questions and answers about the significance of flowchart symbols, the use of loops, and provides examples of flowchart symbols for various operations. Additionally, it differentiates between algorithms and flowcharts, lists rules for writing algorithms, and presents an algorithm for calculating the square and cube of a number.

Uploaded by

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

6.

Algorithm and flowchart

1. Select the correct option.

a. What is the purpose of an algorithm?


Answer: i. to provide a logical and structured way of solving a problem

b. What is the significance of symbols in a flowchart?


Answer: ii. they help in organizing the steps in an algorithm

c. What happens if a condition in a selection is true?


Answer: i. One set of statements is executed

d. Why is a loop used in an algorithm or flowchart?


Answer: ii. to avoid repetition of instructions

e. Which flowchart symbol connects the various shapes to show the flow of the process in a
flowchart?
Answer: iii. Flowline

2. Draw the correct symbol that should be used to represent the following in a flowchart.

a. Print the sum of five numbers: Parallelogram (Output box)

b. Accept the values of two numbers from the user: Parallelogram (Input box)

c. Compare two numbers: Diamond (Decision box)

d. Calculate the product of three numbers: Rectangle (Process box)

e. Display the result of a multiplication: Parallelogram (Output box)

---

3. Answer the following.

a. Differentiate between an algorithm and a flowchart.


Algorithm: A step-by-step procedure for solving a problem.

Flowchart: A graphical representation of an algorithm using symbols.

b. What rules should you follow while writing an algorithm?

1. Write each step clearly and concisely.

2. Use sequential order.

3. Ensure logical correctness.

4. Include a defined start and end.

c. Explain how loops are represented in a flowchart with an example.


Loops in a flowchart are represented using a decision box (diamond shape). Based on
the condition, the flow returns to the beginning of the loop or moves to the next step.
Example: A loop to print numbers 1 to 10 will have a decision box checking if the counter
is less than or equal to 10.

d. Write an algorithm to calculate and display the square and cube of a positive number entered
by the user.

1. Start

2. Accept a positive number (N).

3. Calculate the square of N: Square = N × N.

4. Calculate the cube of N: Cube = N × N × N.

5. Display Square and Cube.


6. Stop

e. Complete the flowchart for determining single, double, and triple-digit numbers:

(A): Display "Single Digit Number"

(B): Is N < 100?

(C): Display "Double Digit Number"

(D): Stop
-

You might also like