Programming and Problem Solving Through Python Language Theory Question

Algorithm and Flowcharts to solve problems

  1. The Pseudocode is
    1. Object code
    2. Flowchart
    3. Algorithm
    4. Coding
    Answer : C
    Explain: Commonly there are three ways to repersent algorithms are - as Flowchart, as Program and Pseudocode.
  2. The stages of program development in logical order are:
    1. Define, Analyze, Write, Test, Document, Debug
    2. Define, Analyze, Develop, Write,Test,Debug, Document
    3. Define, Write, Develop, Analyze, Test, Document
    4. Define, Wite, Test, Document
    Answer : B
    Explain :
  3. A flowchart that outlines the main segments of a program.
    1. Union
    2. Micro
    3. Macro
    4. Queue
    Answer : C
    Explain : Macro flowchart show the important components of a program, where as micro flowcharts show detail components of a program.
  4. Top-down approach is followed in structural programming ?
    1. True
    2. False
    3. Cant'say
    4. May be
    Answer : A
    Explain : The top-down approach is a fundamental concept in structural programming. Structural programming is a programming paradigm that emphasizes the use of structured programming constructs to design and implement programs.
  5. In computer science, algorithm refers to a pictorial representation of a flowchart ?
    1. True
    2. False
    3. Can't say
    4. May be
    Answer : B
    Explain : False. The correct statement would be: In computer science, flowchart refers to a pictorial representation of an algorithm.
  6. The examination of changing values of variables is called stepping ?
    1. True
    2. False
    3. Can't say
    4. May be
    Answer : B
    Explain : It is called tracing. In tracing, the variables are examined where it's value is changing. Debuggers perform the task of step by step examination of the code which is called stepping.
  7. Which symbols is use for input and output operation in flowchart ?
    1. Terminal
    2. Parrallelogram
    3. Diamond
    4. Rectangle
    Answer : B
    Explain : Parrallelogram is used for input and output, terminal use for start and end, Diamond use for decision making, and Rectangle use for processing.
  8. Actual instructions in flowchart repersent in ?
    1. Circle
    2. Boxes
    3. Arrow
    4. Rectangle
    Answer : B
    Explain : Boxes repersent the instruction in flowchart, arrow indicate the flow and circle connect another page.
  9. Flowchart and algorithms are used for ?
    1. Better programming
    2. easy testing and debugging
    3. Efficient Coding
    4. All of the above
    Answer : D
    Explain : Algorithms are used to make programming better, efficient and easy.
  10. Pseudocode can replace
    1. Structure Charts
    2. Flowcharts
    3. Decision tables
    4. None of these.
    Answer : B
    Explain : Flowchart is a graphical repersentation of any program and pseudocode is written in english lanuage to create logic. Similarly, both ( pseudocode and flowchart ) are understand by non-programmers. So, we easily replace flowchart with psuedocode.
  11. What will be the output of following pseudocode ?
    integer a, b
    set a = 9, b = 5
    a = a mod (a - 3)
    b = b mod (b - 3)
    print a+b
    
    1. 4
    2. 5
    3. 9
    4. 8
    Answer : A
    Explain : a - 3 evaluates to 9 - 3 = 6. a mod 6 means finding the remainder when a is divided by 6.
    The remainder of 9 / 6 is 3, so a is updated to 3.
    b - 3 evaluates to 5 - 3 = 2. b mod 2 means finding the remainder when b is divided by 2.
    The remainder of 5 / 2 is 1, so b is updated to 1.So a+b = 3+1 =4.
  12. In Flowchart, which shape repersent two coditions ?
    1. Terminal
    2. Rectangle
    3. Arrows
    4. Diamond
    Answer : D
    Explain : Diamond show two coditions like If this true, then yes and not true then No. Arrows indicate the flow.
    Diamond shape
  13. Solve the flowchart if a=10 and b=20 what will be output ?
    1. 10
    2. 20
    3. Both 10 and 20
    4. None
    Answer : B
    Explain : Program read A and B then check the condition A>B, result false. Now, next step it print B and then process end.
  14. What are the three different types of algorithms construction ?
    1. Input/Output, Decision, repeat
    2. Input, Output, Process
    3. Loop, Input, Output
    4. Sequence, Selection, Repeat/Iteration
    Answer : D
    Explain : An algorithm is made up of three basic building blocks: sequencing, selection, and iteration.
  15. In a flowchart, which of following is used to test the conditon ?
    1. Terminal
    2. Process
    3. Input/output
    4. Decision
    Answer : D
    Explain : Decision is used to test condition and shape is diamond.
  16. The process of drawing a flowchart for an algorithm is called ?
    1. Performance
    2. Algorithm Repersentation
    3. Evaluation
    4. Flowcharting
    Answer : D
    Explain : Flowcharting is process of drawing an flowchart.
  17. The way for solving a problem step by step is known as ?
    1. Design
    2. Planning
    3. Algorithm
    4. Execution
    Answer : C
    Explain : A step by step procedure used to solve the problem is known as Algorithm.
  18. An algorithm that call itself directly or indirectly is called ?
    1. Sub Function
    2. Recursion
    3. Reverse Polish Notation
    4. Travesal Algorithm
    Answer : B
    Explain : The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called a recursive function. Using recursive algorithm, certain problems can be solved quite easily.
  19. What is the symbol used to repersent start and end of a flowchart ?
    1. Oval
    2. rectangle
    3. arrow
    4. diamond
    Answer : A
    Explain : Oval or Terminal used to repersent start and end. Both have same shape.
  20. Which symbol used to indicate the flow between the shapes.
    1. Terminal Box
    2. Arrows
    3. Diamond
    4. Parrallelogram
    Answer : B
    Explain : Arrows is use to indicate flow.

Next Set

2