Page 118 - Computer Science V2.0 Class 11
P. 118

C.  Fill in the blanks.
                 1.  The errors in a program are known as ____________.
                 2.  A _______________ is a diagrammatic representation of an algorithm.
                 3.  A program written in a high-level language is known as _____________.
                 4.  A compiler converts a source code into _____________.
                 5.  ______________ is a way to find and fix bugs in software or applications.
              D.  Answer the following questions:
                 1.  List the steps involved in the Problem-Solving Cycle.
               Ans.  •  Problem Analysis
                    • Program Design
                    • Coding
                    • Testing and Debugging
                 2.  How is an algorithm different from a flowchart?
               Ans.   An algorithm is a step by step description of solution to a problem in simple language. A flowchart is a diagrammatic
                    representation of an algorithm.
                 3.  Write an algorithm to accept two numbers and display their sum and product. Also draw a flowchart.
               Ans.  Input: two numbers num1, num2
                    Process: Compute sum and product of num1 and num2
                    Output: sum and product of num1 and num2
                    input num1 and num2
                    compute sum = num1 + num2, product = num1 * num2
                    print sum, product
                    Flowchart:

                                                                Start





                                                           input num1, num2






                                                          sum = num1 + num2
                                                         product = num1 * num2






                                                           print Sum, Product




                                                                Stop


                 4.  Write an algorithm and draw a flowchart to accept three numbers and display the largest number.
               Ans.  Input: Three numbers num1, num2, num3
                    Process: The number which is larger than each of the other two is the largest of the three numbers
                    Output: Largest  of three numbers num1, num2, and num3

               104   Touchpad Computer Science (Ver. 2.0)-XI
   113   114   115   116   117   118   119   120   121   122   123