Page 53 - Computer_Genius_v2.1_C7_flipbook
P. 53

Example: Draw a flowchart to find profit or loss.
                                                                       Flowchart: Profit and loss
                 In  this  flowchart  we  have  taken  two  inputs,
                 namely cost price and selling price. Then, we will
                                                                                Start
                 calculate profit or loss depending on the values
                 and prints the same.
                                                                           Read Cost price
                 l     Cost  price  (C.P):  It  is the  total  amount  of       (C.P)
                   money that costs a manufacturer to produce a
                   given product or provide a given service.                  Read Selling
                                                                               price (S.P)
                 l    Selling price (S. P): It is the final price of a
                   product. Selling price can also be referred to
                   as list price, market price, or standard price.                          Yes
                                                                             Is S.P > C.P?          Profit= S.P– C.P
                 l    Profit (P): The profit is defined as the amount
                   gained  by  selling  a  product, which  should  be               No
                   more than the cost price of the product.                                           Print Profit
                                                                           Loss = C.P - S.P
                                 Profit = S.P - C.P

                 l   Loss (L): If a  product  is sold  at  a  price  less
                                                                              Print Loss
                 than its cost price then the seller makes a loss.
                                  Loss = C.P - S.P
                                                                                 End





                       Let's REFRESH


                    l    An algorithm is a set of steps in a sequential manner to solve a problem or to complete a task.
                    l    A flowchart is a diagrammatic representation of the step-by-step plan to be followed for solving a
                      task/problem statement.
                    l   While drawing flowcharts we have to use standard symbols.
                    l   While drawing flowcharts we have to work in a consistent direction.

                    l   Disadvantage of flow chart is difficulty in modifications.






                                                       Exercise



                 A.  Multiple choice questions

                    1.  Which of the following is the way to represent an algorithm?
                        (i)   Flowchart                                      (ii)   Pseudocode

                       (iii)   Both (i) and (ii)                            (iv)   None of these


                                                                                       Coding and Flowchart    51
   48   49   50   51   52   53   54   55   56   57   58