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

  • 1
    What is the value of `x` after the code: `x = 5; x += 3;`?
    उत्तर
    (D)
    8
  • 2
    What is the output when using the code: `print "Computer".Substring(3,4)`?
    उत्तर
    (D)
    mpute
  • 3
    What is a disadvantage of using global variables extensively?
    उत्तर
    (B)
    They can be easily accessed by any part of the program, leading to potential unintended modifications.
  • 4
    Which programming concept allows a program to make decisions?
    उत्तर
    (B)
    Selection
  • 5
    Which of the following features are parts of an algorithm?
    उत्तर
    A
    B
    C
    D
  • 6
    What is the primary goal of program documentation?
    उत्तर
    (B)
    To make the code more readable.
  • 7
    What does the acronym 'GUI' stand for?
    उत्तर
    (B)
    Graphical User Interface
  • 8
    Which of the following is a characteristic of a good programming practice?
    उत्तर
    (C)
    Giving descriptive names to variables
  • 9
    What will `print("Python"[2:])` output?
    उत्तर
    (C)
    thon
  • 10
    In a pseudo-code program, what is the purpose of a PROCEDURE?
    उत्तर
    (B)
    To group a set of statements to perform a specific task.
  • 11
    What data structure is described as containing several elements of the same data type, where each element can be accessed using the same identifier name?
    उत्तर
    (B)
    Array
  • 12
    What is the function of `OUTPUT` in programming?
    उत्तर
    (B)
    To display data to the user.
  • 13
    Which of the following is NOT a common string method?
    उत्तर
    (C)
    Append
  • 14
    In the context of programming, what is a 'bug'?
    उत्तर
    (B)
    An error in the code.
  • 15
    What does the algorithm need in order to do output?
    उत्तर
    (B)
    Input
  • 16
    Which data type would be most appropriate for storing the number of students in a class?
    उत्तर
    (D)
    INTEGER
  • 17
    Which is the correct syntax to call a procedure named 'CalculateMarks'?
    उत्तर
    (B)
    CALL CalculateMarks
  • 18
    What type of statement allows a program to choose between different actions based on a condition?
    उत्तर
    (B)
    Selection Statement
  • 19
    What does 'scope' refer to in relation to variables?
    उत्तर
    (B)
    Where a variable is accessible within the code.
  • 20
    Which programming paradigm is likely being used based on the presented examples?
    उत्तर
    (C)
    Procedural Programming
  • 21
    What is the purpose of the `+=` operator in Python (or similar operators in other languages)?
    उत्तर
    (C)
    To add a value to a variable and assign the result to the same variable.
  • 22
    What does the term 'sequence' refer to in the context of an algorithm?
    उत्तर
    (B)
    The order in which steps are executed.
  • 23
    What is the role of a parameter within a function or procedure?
    उत्तर
    (C)
    To receive data that is passed into the function or procedure.
  • 24
    What is the role of the `DIV` library routine?
    उत्तर
    (B)
    To return the quotient (whole number) of a division.
  • 25
    Why is it beneficial to use descriptive identifier names?
    उत्तर
    (C)
    It improves the code's readability and maintainability.
  • 26
    In the context of programming, what does 'modularity' refer to?
    उत्तर
    (C)
    Breaking down a program into smaller, self-contained, and reusable modules.
  • 27
    What type of loop is used to repeat a block of code as long as a condition is true?
    उत्तर
    (B)
    WHILE loop
  • 28
    Which string function is typically used to locate a specified character or substring within a string?
    उत्तर
    (C)
    Index or Find
  • 29
    What does the term 'index' refer to when discussing arrays?
    उत्तर
    (C)
    The location of an element within the array.
  • 30
    What is the purpose of debugging in programming?
    उत्तर
    (B)
    To test and fix errors in the code.
  • 31
    In the provided pseudo-code snippets, what does the constant `NumberSubjects` likely represent?
    उत्तर
    (C)
    The total number of subjects a student is taking.
  • 32
    What is the correct data type for a value that can store decimal numbers?
    उत्तर
    (D)
    Double/Real
  • 33
    In the context of the program, what does the constant `NumberSubjects` likely represent?
    उत्तर
    (B)
    The number of subjects a student takes.
  • 34
    In the provided context of student mark calculations, what is the likely purpose of the variable `studentTotal`?
    उत्तर
    (B)
    The total marks obtained by a student.
  • 35
    What is the main role of a programming language's syntax?
    उत्तर
    (A)
    To define the rules for writing valid statements.
  • 36
    What data type is typically used to store a whole number?
    उत्तर
    (B)
    Integer
  • 37
    What does the assignment operator do?
    उत्तर
    (C)
    Assigns a value to a variable
  • 38
    What is the term for the process of repeating a set of instructions in a program?
    उत्तर
    (B)
    Iteration
  • 39
    Which of the following is an example of a logical operator?
    उत्तर
    (C)
    AND
  • 40
    Which of the following best describes an 'algorithm'?
    उत्तर
    (B)
    A set of instructions for a specific task.
  • 41
    Which one is a comment feature in the Python language?
    उत्तर
    (C)
    '# '
  • 42
    What is the purpose of an 'IF' statement in programming?
    उत्तर
    (B)
    To make decisions based on a condition.
  • 43
    What does the acronym "GUI" stand for?
    उत्तर
    (A)
    Graphical User Interface
  • 44
    In pseudo code, what is the purpose of the keyword "OUTPUT"?
    उत्तर
    (B)
    To display information to the user.
  • 45
    In the provided pseudocode, what does the value 999 represent?
    उत्तर
    (C)
    A delimiter to finish the loop
  • 46
    What is the purpose of indentation in Python?
    उत्तर
    (D)
    All of the above
  • 47
    What is the range of values for a boolean data type?
    उत्तर
    (B)
    True or False
  • 48
    What is the output of the code: `print(type(True))`
    उत्तर
    (C)
  • 49
    What does the term 'selection' refer to in programming?
    उत्तर
    (C)
    Choosing different paths of code execution.
  • 50
    If a function needs to return multiple values, what is one common way to achieve this in programming?
    उत्तर
    (C)
    Return a single array or object containing the multiple values.