
W14: CP07 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
- Q1Which control structure is controlled by precedence and associativity?Function callsWithin expressionsAmong program unitsSelection statements30s
- Q2What are the three levels of control flow mentioned in the course packet?Within expressions, among program units, and program statementsBranching, selection, and iterationFunction calls, if statements, and loopsAmong expressions, function calls, and loops30s
- Q3It is defined as a control statement plus statements whose execution it controls?LoopingControl structureFunction callsConditional statements30s
- Q4In the context of selection statements, what does the 'else' clause represent?The statement executed when the control expression is trueThe end of the if statementA loop that executes a default actionThe statement executed when the control expression is false30s
- Q5Which 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
- Q6In FORTRAN, what is the purpose of the 'GOTO' statement in selection statements?To select multiple statementsTo create loopsTo handle errorsTo improve readability30s
- Q7What 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 variableThe control expression must be a stringIt does not support a default case30s
- Q8Which of the following is a design choice for the 'switch' statement?Selectable segments can only be single statementsSelectable segments can be statement sequences, blocks, or compound statementsThe control expression must be a stringIt must have a pre-test condition30s
- Q9In 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
- Q10Which statement correctly describes counter-controlled loops?They must include a control expression that evaluates to a booleanThey rely on a loop variable with an initial, terminal, and stepsize valueThey only run a fixed number of timesThey do not allow the loop variable to be modified within the loop body30s
- Q11In C's 'for' statement, which expression is evaluated once at the beginning of the loop? ([expr_1] ; [expr_2] ; [expr_3])expr_2expr_1expr_3None of the above30s
- Q12Which type of loop control is based on a boolean expression and can be either pre-test or post-test?Logically-controlled loopsSelection statementsCounter-controlled loopsConditional branches30s
- Q13What is the purpose of the 'continue' statement in loops?To terminate the loopTo transfer control to a labeled statementTo evaluate the loop condition again immediatelyTo skip the remainder of iteration30s
- Q14In the context of iteration based on data structures, what is an iterator function?A function that terminates the loopA function that skips the current iterationA function that initializes the loop variableA function that returns the next element in a data structure30s
- Q15Which of the following is a design issue for nested loops with user-located loop control mechanisms?How to handle multiple cases within the loopWhether the loop variable can be modified within the loopWhether control should be transferable out of more than one loopThe loop must only be controlled by a logical expression30s