Computer Fundamentals and Programming



Download 1.62 Mb.
Page4/5
Date24.05.2022
Size1.62 Mb.
#58873
1   2   3   4   5
MODULE-3 FLOWCHART
Flowchart sample 2
How to find profit or loss

In this problem the goal is to find whether Juan makes a profit or loss.


We know the Cost Price and the Selling Price. We can read them as input, so they are represented as parallelograms.

Next we have to compare Selling Price and Cost Price to find which price is more.


This will tell us whether Juan has made profit or loss.
How do we show comparison in a flowchart?
Can you phrase this step as a question with the two possible answers?
We can ask a question “Is selling price more than cost price?”

The answer to this question can be “Yes” or “No”. If, answer is “Yes” we have to calculate profit. If, answer is “No” we have to calculate loss. This decision taking step is represented as follows in a flowchart.



_____________________________________________________________________
If the answer is “Yes”, it means that selling price is more than the cost price and Juan has made profit. Profit is calculated as Selling price – Cost price.

______________________________________________________________________


If the answer is “No”, it means that cost price is less than selling price and Juan has made loss. Loss is calculated as Cost price – Selling price

We have used logical reasoning to solve this problem.


Now complete the flowchart.

This is how to draw basic flowchart program design. Do you think you can draw flowchart now?



Let’s try this!


  1. Write an algorithm to convert the length in feet to centimeter.


  1. Match the elements of a flowchart and their purpose of use in the following:

Purpose Use

  1. Calculate total A, B, C Loop

  2. Indicate that the problem has been solved Start

  3. Find if the number is greater than the other Process

  4. Read a number and calculate the factorial of a number Input

  5. Read three numbers Stop

  6. Print the Total Decision

  7. Indicate beginning of the problem solving flow Output


Summary

This is how to draw flowchart for solving problems.


By looking at a Flowchart, one can understand the operations and sequence of operations performed in a system.





Download 1.62 Mb.

Share with your friends:
1   2   3   4   5




The database is protected by copyright ©ininet.org 2024
send message

    Main page