
W13: CP06 Quiz (CSCI0823)
Quiz by Bryan N. Manalaotao
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
15 questions
Show answers
- Q1Expressions 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 RetrievalData StorageAssignmentData Transmission30s
- Q2Which operator has the highest precedence in most programming languages?ParenthesesUnary operatorsMultiplication (*)Addition (+)30s
- Q3In 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
- Q4Which of the following is a solution to the problem of functional side effects?Using dynamic type checkingAllowing non-local references in functionsEncouraging implicit type conversionsDisallowing two-way parameters in functions30s
- Q5A program has the property of referential transparency if:Any two expressions with the same value can be substituted for one another without affecting the programIt uses explicit type conversionsFunctions do not change global variablesIt does not use any functions30s
- Q6Which of the following languages does NOT allow user-defined overloaded operators?AdaC++JavaRuby30s
- Q7Which of the following is a widening conversion?short to longint to bytedouble to floatfloat to int30s
- Q8In most programming languages, how are mixed-mode expressions typically handled?Using narrowing conversionsDisallowing such expressionsUsing explicit type conversionUsing implicit type conversion (coercion)30s
- Q9Which Boolean operator/s has equal precedence in some language?NOT (!)AND (&&) / OR (||)OR (||) / XOR (^)XOR (^)30s
- Q10Which of the following statements about short-circuit evaluation is true?Short-circuit evaluation is more efficient than non-short-circuit evaluationAll languages use short-circuit evaluation for Boolean operatorsShort-circuit evaluation always evaluates all operandsC, C++, and Java use short-circuit evaluation for the usual Boolean operators30s
- Q11Which language uses := as the assignment operator?PascalFORTRANBASICC++30s
- Q12What is the shorthand syntax for adding two values in most modern programming languages?a = a // ba += ba =+ ba == b30s
- Q13Which of the following languages allows the assignment statement to produce a result and be used as an operand?ALGOLPascalFORTRANC30s
- Q14In which language can you use the syntax ($first, $second) = ($second, $first); for multiple-target, multiple-source assignments?JavaPythonRubyC++30s
- Q15Which of the following statements is true about mixed-mode assignments in Java?Java uses implicit type conversion for all numeric typesJava only allows widening assignment coercionsJava disallows all mixed-mode assignmentsJava uses both widening and narrowing coercions30s