placeholder image to represent content

W14: CP07 Quiz (CSCI0823)

Quiz by Bryan N. Manalaotao

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
15 questions
Show answers
  • Q1
    Which control structure is controlled by precedence and associativity?
    Function calls
    Within expressions
    Among program units
    Selection statements
    30s
  • Q2
    What are the three levels of control flow mentioned in the course packet?
    Within expressions, among program units, and program statements
    Branching, selection, and iteration
    Function calls, if statements, and loops
    Among expressions, function calls, and loops
    30s
  • Q3
    It is defined as a control statement plus statements whose execution it controls?
    Looping
    Control structure
    Function calls
    Conditional statements
    30s
  • Q4
    In the context of selection statements, what does the 'else' clause represent?
    The statement executed when the control expression is true
    The end of the if statement
    A loop that executes a default action
    The statement executed when the control expression is false
    30s
  • Q5
    Which of the following design issues relates to two-way selection statements?
    What is the form and type of the control expression?
    How is iteration controlled?
    What are the type and scope of the loop variable?
    Is execution flow through the structure restricted to a single segment?
    30s
  • Q6
    In FORTRAN, what is the purpose of the 'GOTO' statement in selection statements?
    To select multiple statements
    To create loops
    To handle errors
    To improve readability
    30s
  • Q7
    What is a key characteristic of the 'switch' statement in C-like languages?
    It allows for multiple cases to be executed in one pass (fall-through behavior)
    It must have a loop variable
    The control expression must be a string
    It does not support a default case
    30s
  • Q8
    Which of the following is a design choice for the 'switch' statement?
    Selectable segments can only be single statements
    Selectable segments can be statement sequences, blocks, or compound statements
    The control expression must be a string
    It must have a pre-test condition
    30s
  • Q9
    In Scheme, what form does the 'cond' special form take?
    (case expr (valuelist1 result1) ... (else defaultResult))
    switch (expression) {case1: stmt1; ... default: stmt2;}
    (cond (test1 result1) ... (testn resultn) (else defaultResult))
    if (test) {result} else {defaultResult}
    30s
  • Q10
    Which statement correctly describes counter-controlled loops?
    They must include a control expression that evaluates to a boolean
    They rely on a loop variable with an initial, terminal, and stepsize value
    They only run a fixed number of times
    They do not allow the loop variable to be modified within the loop body
    30s
  • Q11
    In C's 'for' statement, which expression is evaluated once at the beginning of the loop? ([expr_1] ; [expr_2] ; [expr_3])
    expr_2
    expr_1
    expr_3
    None of the above
    30s
  • Q12
    Which type of loop control is based on a boolean expression and can be either pre-test or post-test?
    Logically-controlled loops
    Selection statements
    Counter-controlled loops
    Conditional branches
    30s
  • Q13
    What is the purpose of the 'continue' statement in loops?
    To terminate the loop
    To transfer control to a labeled statement
    To evaluate the loop condition again immediately
    To skip the remainder of iteration
    30s
  • Q14
    In the context of iteration based on data structures, what is an iterator function?
    A function that terminates the loop
    A function that skips the current iteration
    A function that initializes the loop variable
    A function that returns the next element in a data structure
    30s
  • Q15
    Which of the following is a design issue for nested loops with user-located loop control mechanisms?
    How to handle multiple cases within the loop
    Whether the loop variable can be modified within the loop
    Whether control should be transferable out of more than one loop
    The loop must only be controlled by a logical expression
    30s

Teachers give this quiz to your class