Computer Science for IGCSE & O level - Programming (Section 11)

  • 1
    Which statements are always part of a function definition?
    উত্তর
    (D)
    All of the above.
  • 2
    What is the most common way to handle a file if an error is detected?
    উত্তর
    (D)
    Use exception handling
  • 3
    What does the MOD function return?
    উত্তর
    (C)
    The remainder of a division
  • 4
    What does a Selection statement enable a program to do?
    উত্তর
    (C)
    Make choices based on conditions.
  • 5
    What does the step value of a FOR loop determine?
    উত্তর
    (C)
    The increment or decrement applied to the loop variable in each iteration.
  • 6
    What is the basic definition of a variable?
    উত্তর
    (C)
    A named storage for data.
  • 7
    Which of these is NOT a part of a well-structured program?
    উত্তর
    (C)
    Complex Structure.
  • 8
    What does the code snippet `OUTPUT
    উত্তর
    (C)
    Displays 'Enter some value' on the screen.
  • 9
    What does the symbol '%' represent in programming contexts (as used in the provided image)?
    উত্তর
    (B)
    Modulo (remainder after division)
  • 10
    Which of the following is an example of file handling in the context of this document?
    উত্তর
    (B)
    Reading data from a file.
  • 11
    Which of the following is a recommended practice for creating a maintainable program?
    উত্তর
    A
    C
    D
  • 12
    What operations are common in programming?
    উত্তর
    A
    B
    C
    D
  • 13
    In nested IF-ELSE statements, what is the relationship between the outer and inner blocks of code?
    উত্তর
    (B)
    The inner block executes only if the outer block's condition is met.
  • 14
    In the totaling example, how does the code update the total weight?
    উত্তর
    (C)
    By adding Weight to TotalWeight.
  • 15
    Which operators can be used to perform calculations?
    উত্তর
    A
    B
    D
  • 16
    What is the output value of 'Average' in the provided pseudocode after the loop completes if the input marks are 15, 25 and 30?
    উত্তর
    (B)
    23.33
  • 17
    What is the purpose of version control systems like Git?
    উত্তর
    (B)
    To manage different versions of code and facilitate collaboration
  • 18
    Which type of loop guarantees that the code within the loop's body will always execute at least once?
    উত্তর
    (D)
    Repeat...Until loop
  • 19
    Which of the following is a characteristic of a constant in a computer program?
    উত্তর
    (C)
    Its value doesn't change during the program's execution.
  • 20
    In the pseudocode, what action does the statement `TOTAL = TOTAL + MARK` perform?
    উত্তর
    (B)
    Adds the current mark to the total.
  • 21
    Which data type would be best suited for storing the value of PI (3.14159)?
    উত্তর
    (D)
    Float
  • 22
    What is the primary purpose of storing data in a file, as mentioned in the context of computer programming?
    উত্তর
    (B)
    To permanently store data that will be required again.
  • 23
    What is the use of the `IF` statement in the pseudo-code examples?
    উত্তর
    (B)
    To make a decision based on a condition.
  • 24
    Which of the following are characteristics of a good algorithm?
    উত্তর
    A
    B
    C
  • 25
    Which logical operator yields TRUE only if both operands are TRUE?
    উত্তর
    (B)
    AND
  • 26
    In the Totaling examples, what operation is performed by the statement: `TotalWeight = TotalWeight + Weight;`?
    উত্তর
    (A)
    Adding weight to total weight.
  • 27
    In the Totaling example, how is the variable 'TotalWeight' updated?
    উত্তর
    (C)
    TotalWeight = TotalWeight + Weight
  • 28
    Which data type is most appropriate for storing a whole number (integer) in most programming languages?
    উত্তর
    (C)
    Integer
  • 29
    What is the primary difference between procedures and functions?
    উত্তর
    (A)
    Functions always return a value, while procedures do not.
  • 30
    What does the 'x' mode do when you open a file?
    উত্তর
    (C)
    Creates the file if it does not exist and opens it for writing.
  • 31
    Which of the following is an example of a library routine?
    উত্তর
    (C)
    The MOD function.
  • 32
    What is the purpose of the lines: `NumOfStudents = 5` and `NumOfSubjects = 4` in the provided pseudo-code?
    উত্তর
    (B)
    To initialize the number of students and subjects.
  • 33
    If the condition in an IF statement is false, which part of the statement will be executed?
    উত্তর
    (C)
    The ELSE block (if present).
  • 34
    Which of the following is considered a function that programmers use for comment in many languages?
    উত্তর
    (D)
    All of the above
  • 35
    What's the primary function of the `Uppercase` method in string manipulation?
    উত্তর
    (C)
    To convert all characters to uppercase.
  • 36
    Which of the following are characteristics of a good identifier name?
    উত্তর
    A
    B
    D
  • 37
    What is typically the symbol for division in programming?
    উত্তর
    (B)
    /
  • 38
    Which statement is true about the provided example of a Pre-condition loop?
    উত্তর
    (B)
    The loop may not execute at all.
  • 39
    What data types are used in Python, based on the code provided?
    উত্তর
    A
    B
    C
  • 40
    What kind of loop structure begins by checking the condition *before* executing the code block?
    উত্তর
    (B)
    Pre-condition loop
  • 41
    In the given pseudocode, what action is repeatedly performed within the loop?
    উত্তর
    (B)
    Adding a mark to the total.
  • 42
    In the context of programming, what is a 'variable'?
    উত্তর
    (B)
    A named storage location for data that can change during program execution.
  • 43
    In pseudocode, which command is commonly used to take input from a user?
    উত্তর
    (C)
    INPUT
  • 44
    What is the purpose of a 'loop' in programming?
    উত্তর
    (A)
    To repeat a block of code multiple times.
  • 45
    What does the `Lowercase` string method typically do?
    উত্তর
    (C)
    Convert all characters in the string to lowercase.
  • 46
    What is the purpose of a 'function' in programming?
    উত্তর
    (B)
    To create a reusable block of code that performs a specific task.
  • 47
    What type of loop is represented by this code structure? ``` DO Statements WHILE condition ```
    উত্তর
    (B)
    Post-condition loop
  • 48
    What type of algorithm is demonstrated in the provided "Worked example"?
    উত্তর
    (C)
    Calculation algorithm
  • 49
    In the Java example provided, what object is used to write to a file?
    উত্তর
    (C)
    FileWriter
  • 50
    Which type of loop is exemplified by this code: ``` WHILE condition DO Statements ENDWHILE ```
    উত্তর
    (B)
    Pre-condition loop