placeholder image to represent content

W13: CP06 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
    Expressions are the fundamental means of specifying computations in a programming language. Which of the following is a primary role of expressions in imperative languages?
    Data Retrieval
    Data Storage
    Assignment
    Data Transmission
    30s
  • Q2
    Which operator has the highest precedence in most programming languages?
    Parentheses
    Unary operators
    Multiplication (*)
    Addition (+)
    30s
  • Q3
    In C-based languages, which of the following is an example of a conditional expression?
    average = (count == 0) ? 0 : sum / count;
    a = b + c;
    if (a > b) a = b;
    while (a < b) a++;
    30s
  • Q4
    Which of the following is a solution to the problem of functional side effects?
    Using dynamic type checking
    Allowing non-local references in functions
    Encouraging implicit type conversions
    Disallowing two-way parameters in functions
    30s
  • Q5
    A program has the property of referential transparency if:
    Any two expressions with the same value can be substituted for one another without affecting the program
    It uses explicit type conversions
    Functions do not change global variables
    It does not use any functions
    30s
  • Q6
    Which of the following languages does NOT allow user-defined overloaded operators?
    Ada
    C++
    Java
    Ruby
    30s
  • Q7
    Which of the following is a widening conversion?
    short to long
    int to byte
    double to float
    float to int
    30s
  • Q8
    In most programming languages, how are mixed-mode expressions typically handled?
    Using narrowing conversions
    Disallowing such expressions
    Using explicit type conversion
    Using implicit type conversion (coercion)
    30s
  • Q9
    Which Boolean operator/s has equal precedence in some language?
    NOT (!)
    AND (&&) / OR (||)
    OR (||) / XOR (^)
    XOR (^)
    30s
  • Q10
    Which of the following statements about short-circuit evaluation is true?
    Short-circuit evaluation is more efficient than non-short-circuit evaluation
    All languages use short-circuit evaluation for Boolean operators
    Short-circuit evaluation always evaluates all operands
    C, C++, and Java use short-circuit evaluation for the usual Boolean operators
    30s
  • Q11
    Which language uses := as the assignment operator?
    Pascal
    FORTRAN
    BASIC
    C++
    30s
  • Q12
    What is the shorthand syntax for adding two values in most modern programming languages?
    a = a // b
    a += b
    a =+ b
    a == b
    30s
  • Q13
    Which of the following languages allows the assignment statement to produce a result and be used as an operand?
    ALGOL
    Pascal
    FORTRAN
    C
    30s
  • Q14
    In which language can you use the syntax ($first, $second) = ($second, $first); for multiple-target, multiple-source assignments?
    Java
    Python
    Ruby
    C++
    30s
  • Q15
    Which of the following statements is true about mixed-mode assignments in Java?
    Java uses implicit type conversion for all numeric types
    Java only allows widening assignment coercions
    Java disallows all mixed-mode assignments
    Java uses both widening and narrowing coercions
    30s

Teachers give this quiz to your class