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

  • 1
    What does the acronym "IDE" stand for?
    Cevap
    (A)
    Integrated Development Environment
  • 2
    What is the purpose of a comment in a programming language?
    Cevap
    (B)
    To provide explanations and notes within the code.
  • 3
    Which operator will give you the quotient when two numbers are divided?
    Cevap
    (B)
    %
  • 4
    What will the following code print? `print "Hello"[1]`
    Cevap
    (B)
    e
  • 5
    How does using clear identifier names help improve code quality?
    Cevap
    (C)
    It makes the code more readable and easier to maintain.
  • 6
    Which statement will output the sum of two numbers?
    Cevap
    (A)
    Calculate Number1 + Number2
  • 7
    What is the role of an `AND` operator in a conditional statement?
    Cevap
    (B)
    It executes code only if all conditions are true.
  • 8
    In pseudocode, what is the common keyword used for selection?
    Cevap
    (B)
    IF
  • 9
    What is the primary purpose of a loop in programming?
    Cevap
    (B)
    To execute a block of code repeatedly.
  • 10
    Which of the following are common components of a function's definition?
    Cevap
    A
    B
    C
  • 11
    What data type is the best choice for storing a person's age?
    Cevap
    (C)
    Integer
  • 12
    What is the term for a step-by-step procedure for solving a problem?
    Cevap
    (B)
    Algorithm
  • 13
    What does a `CASE` statement do?
    Cevap
    (D)
    It performs different actions based on the value of a variable.
  • 14
    What does the term 'algorithm' refer to in computer science?
    Cevap
    (B)
    A set of instructions to solve a problem.
  • 15
    What is the function of 'input' in the context of programming?
    Cevap
    (A)
    To get information from the user.
  • 16
    Which concept is demonstrated by using the 'IF' statement in a program?
    Cevap
    (C)
    Selection
  • 17
    What will this code print? `print "Hello".length()` (Assuming a language where length is a method of strings)
    Cevap
    (B)
    5
  • 18
    Which of the following is NOT a data type?
    Cevap
    (D)
    Loop
  • 19
    Which data type is the best fit for representing a person's height?
    Cevap
    (B)
    REAL
  • 20
    What is the primary purpose of an `IF` statement in a programming language?
    Cevap
    (C)
    To execute a block of code conditionally.
  • 21
    In most programming languages, what does `!=` represent?
    Cevap
    (B)
    Not equal to
  • 22
    In Python, what will be the output of `print(15 % 4)`?
    Cevap
    (C)
    3
  • 23
    Which is the core feature that differentiates a function from a procedure?
    Cevap
    (B)
    Functions always return a value.
  • 24
    What is the purpose of code testing?
    Cevap
    (C)
    To check for and fix any errors (bugs).
  • 25
    Which operator is used to check equality?
    Cevap
    (B)
    ==
  • 26
    What is the purpose of an `IF...ELSE IF...ELSE` statement?
    Cevap
    (B)
    To check for multiple conditions and execute different code blocks based on which condition is met.
  • 27
    What is the keyword used in Python to define a function?
    Cevap
    (C)
    def
  • 28
    How does the use of procedures improve the structure of a program?
    Cevap
    (C)
    By breaking a larger task into smaller, manageable units.
  • 29
    Which programming practice significantly enhances the organization and reusability of code?
    Cevap
    (C)
    Employing modular design principles.
  • 30
    What does an 'operator' do in a programming context?
    Cevap
    (B)
    Performs an action on operands.
  • 31
    What will be the result of "cat" < "dog" in most programming languages?
    Cevap
    (A)
    True
  • 32
    What is code testing primarily used for?
    Cevap
    (B)
    To identify and fix errors.
  • 33
    What is the purpose of an 'input' statement in a program?
    Cevap
    (B)
    To receive data from the user.
  • 34
    What does modular programming emphasize?
    Cevap
    (B)
    Creating smaller, reusable blocks of code.
  • 35
    When using an `IF-ELSE` statement, what does the `ELSE` block contain?
    Cevap
    (A)
    Code to be executed if the `IF` condition is false.
  • 36
    When should you use a conditional statement (e.g., `IF` statement)?
    Cevap
    (B)
    To execute different code blocks based on a condition.
  • 37
    What is the function of the `Substring` method?
    Cevap
    (C)
    To extract a portion of a string.
  • 38
    Which operator is used to perform an assignment?
    Cevap
    (A)
    =
  • 39
    What does 'compiling' a program mean?
    Cevap
    (B)
    Translating source code into machine code.
  • 40
    How is the `RANDOM` routine typically used?
    Cevap
    (A)
    To generate a random number.
  • 41
    What will be the output from the code below? `IF age >= 18 THEN PRINT "You are an adult" ENDIF`
    Cevap
    A
    D
  • 42
    Which of the following is an example of a valid loop in Python?
    Cevap
    (C)
    for i in range(5):
  • 43
    Which type of code contains only one single value?
    Cevap
    (A)
    char
  • 44
    What is the purpose of the `OUTPUT` statement in pseudo-code?
    Cevap
    (B)
    To display information to the user.
  • 45
    What is the main difference between a compiler and an interpreter?
    Cevap
    (B)
    A compiler translates the entire code at once, while an interpreter translates code line by line.
  • 46
    In a programming context, what is a 'function'?
    Cevap
    (A)
    A named block of code that performs a specific task.
  • 47
    What does the 'print' function usually do?
    Cevap
    (B)
    Displays information on the screen.
  • 48
    What is the difference between '==' and '=' in programming?
    Cevap
    (C)
    '==' is for comparison, '=' is for assignment.
  • 49
    What do you use when storing numbers with fractions or decimals?
    Cevap
    (D)
    Real/Double
  • 50
    Which concept is being implemented in a program when a conditional statement is employed?
    Cevap
    (B)
    Selection