Programming and Problem Solving Through Python Language Theory Question

Algorithm and Flowcharts to solve problems

  1. Actual instructions in flowcharting are represented in __________.
    1. Circles
    2. Boxes
    3. Arrows
    4. Lines
    Answer : B
    Explain: Instructions are written in boxes. Boxes are connected by using arrows, and arrow also show the flow of program.
  2. Any algorithm is a program written according to proper syntax
    1. True
    2. False
    3. Can't say
    4. May be
    Answer : B
    Explain: An algorithm is represented in the form of a programming language is called a program.
  3. Flowcharts and algorithms are used for __________.
    1. Better programming
    2. Efficient coding
    3. Easy testing and debugging
    4. All of the above
    Answer : D
    Explain: Flowcharts helps to solve complex problems as it breaks down into simpler steps.
  4. __________ is a connector showing the relationship between the representative shapes.
    1. Line
    2. Arrow
    3. Process
    4. Box
    Answer : D
    Explain: Arrows are the connectors that show the relationship between different shapes. They also show the flow of the program.
  5. Method which uses a list of well-defined instructions to complete a task starting from a given initial state to end state is called as __________.
    1. Program
    2. Algorithm
    3. Flowchart
    4. Both (A) and (C)
    Answer : B
    Explain: An algorithm is a procedure used for solving a problem or performing a computation. Commonly used ways to repersent an algorithm are : as program, as flowchart and as pseudocode.
  6. An algorithm represented in the form of programming languages is __________.
    1. Flowchart
    2. Pseudo code
    3. Program
    4. None of above
    Answer : C
    Explain: Any algorithm that is written in th form of programming language means it is a program.
  7. 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: In computer science, flowchart refers to a pictorial representation of an algorithm.
  8. A flowchart that outlines the main segments of a program.
    1. Queue
    2. Macro
    3. Micro
    4. Union
    Answer : B
    Explain: Macro flowchart cover main segments and micro flowchart cover deatils of program.
  9. Hierarchy in a pseudo-code can be shown by __________.
    1. Curly Braces
    2. Round Brackets
    3. Indentation
    4. Semicolon
    Answer : C
    Explain: Using indentation to show hierarchy in a code. Using indentation improves code by look and make easy to understand.
  10. The examination of changing values of variables is called ____ .
    1. Stepping
    2. Tracing
    3. Notice
    4. Examine
    Answer : B
    Explain: The examination of changing values of variables is called tracing.
  11. The operation represented by a parallelogram is called as__________.
    1. Input/Output
    2. Comparison
    3. Assignment
    4. Conditions
    Answer : A
    Explain: Parallelogram repersent the input and output operation in flowchart.
  12. In a flow chart, which of the following is used to test the condition ?
    1. Terminal
    2. Process
    3. Input/Output
    4. Decision
    Answer : D
    Explain: Decision symbol is also known as diamond symbol, which is used to test conditions.
  13. The process of drawing a flowchart for an algorithm is called __________.
    1. Performance
    2. Algorithmic Representation
    3. Evaluation
    4. Flowcharting
    Answer : D
  14. What are the three different types of algorithm constructions ?
    1. Input/Output, Decision, Repeat
    2. Input, Output, Process
    3. Loop, Input/Output, Process
    4. Sequence, Selection, Repeat
    Answer : D
    Explain: Computer scientists have defined three constructs for a structured program or algorithm. These are Sequence, Selection (Condition) and Repeat (Loop)
  15. Algorithms cannot be represented by __________.
    1. pseudo codes
    2. syntax
    3. flowcharts
    4. programs
    Answer : B
    Explain: Algorithm mainly repersent in three ways: pseudo code, flowchart and program.
  16. A process is expressed in a flowchart by __________.
    1. Rectangle
    2. A circle
    3. Parallelogram
    4. A diamond
    Answer : A
    Explain: Rectangle symbol is use to express process in flowchart.
  17. Algorithms cannot be repersented by
    1. Flowchart
    2. Pseudocode
    3. Programs
    4. syntax
    Answer : D
    Explain : Algorithms can be repersent in three ways : as Flowchart, as Pseudocode, and as Programs
  18. Solving a problem step by step is known as ?
    1. Sequence
    2. Design
    3. Construct
    4. Algorithm
    Answer : D
    Explain : Algorithm - it is step by step description of how to arrive at a solution of a problem. It is a sequence of instruction.
  19. Solve the given psuedocode
    Integer x, y, z
    Set y = 1, x = 2
    z = x ^ y
    Print z
    
    1. 5
    2. 0
    3. 3
    4. 1
    Answer : C
    Explain : In this code y value is 1 ,
    x value is 2. Now, z=x^y ( caret symbol means use XOR operator).
    So it first convert x= 1 = 0001 and y = 2 = 0010 .
    After that use XOR operator 0001 ^ 0010 = 0011, then it convert to no. which is 3. So, here answer is 3.
  20. Solve the given psuedocode :
    Integer a, b, c 
    Set b = 4, c = 5 
    for(a from 2 to 4, stop=5) 
      print c 
      b = b - 1 
      c = c + b 
    end
    
    
    1. 1,2,3
    2. 5
    3. 25,0,2
    4. 5,8,10
    Answer : D
    Explain : Here, loop start a value is 2, it print c=5. Now a=3, it print c latest value which is 8. Again one more time loop run a value is 4, it print c value which is 10.

Next Set

1