Page 90 - Computer Science Class 11 With Functions
P. 90

4                                               PROBLEM SOLVING
                                                                     PROBLEM SOLVING













          Chapter Outline


          4.1 Problem-Solving Steps                          4.2 Algorithm, Flowchart, and Pseudocode







        Introduction

        Suppose you are driving to a destination. Suddenly, you encounter a problem - a traffic jam 100 meters away. You recall
        from memory that there is an alternate route. You realize that, although the alternative route is longer, it is still likely
        to take less time than getting stuck in a traffic jam. So, you take a U-turn that takes you to an alternative route. Thus,
        your problem-solving skills enabled you to avoid traffic congestion and reach your destination faster. Consider another
        scenario: Your car breaks down while you are driving, and you call a 24-hour car helpline to arrange for a mechanic.
        On arrival, the mechanic first checks the fuel status. As he finds enough fuel in the tank, he checks whether the battery
        has drained. As he discovers the battery is not drained, he checks for engine failure using an onboard diagnostic (OBD)
        module that he has brought with him. The OBD module indicates that the engine is getting too hot. Knowing this, he
        fixes the problem, and the car runs again.
        In solving the first problem, you made use of your own problem-solving skills. To solve the second problem, you needed
        a car mechanic. The mechanic, in turn, needed a specialized diagnostic module, which is a piece of hardware with
        software built in. We just noted that the mechanic knew the procedure (also called an algorithm) to set the car right.
        He also realized his limitations. So, he brought with him an OBD module to assist him.  He could solve the problem of
        car failure because he knew how to use the OBD module in an interactive manner.  A computer is a great tool to solve a
        large number of problems. However, to use a computer to solve a problem, you need to develop problem-solving skills
        using computers. Indeed, an OBD module is a specialized computer. In this chapter, we will study the steps involved in
        solving a problem using a computer.

        4.1 Problem-Solving Steps


        Given  a  trivial  problem,  one  can  visualize  the  solution  instantly.  But  a  systematic  approach  is  needed  to  solve  a
        complicated  problem.  If  you  want  your  friend  to  help  you  solve  a  problem,  you  must  define  it  completely  and
        unambiguously. If the problem description is ambiguous, it is highly unlikely that your friend will be able to provide
        you with the desired solution. In the same way, the first step in using a computer to solve a problem is to describe it
        clearly. Next, one analyzes the problem and develops a solution strategy (called an algorithm). Finally, code is written
        to implement the algorithm.

          88   Touchpad Computer Science-XI
   85   86   87   88   89   90   91   92   93   94   95