COP 3014 FSU Exam 2 With Correct
Questions And Answers 2024
The .assignment .operator .________ .assigns .the .value .of .the .expression .on .its .right .to .the
.variable .on .its .left.
.
.->
.#
.=
.<- .- .correct .answer.=
The .data .type .bool:
.
.Can .take .on .values .-1, .0 .or .1.
.Can .take .on .any .expression .as .a .value.
.Can .only .be .used .in .a .selection .statement.
.Can .take .on .values .true .and .false. .- .correct .answer.Can .take .on .values .true .and .false
What .is .the .final .value .of .x .after .performing .the .following .operations? .
.int .x .= .21;
.double .y .= .6;
.double .z .= .14;
.y .= .x ./ .z;
.x .= .5.5 .* .y;
.
.5
.8
.5.5
.8.25 .- .correct .answer.8
If .a .do...while .structure .is .used:
.
The .body .of .the .loop .will .execute .at .least .once.
.
, . An .off-by-one .error .will .not .occur.
.An .infinite .loop .will .not .take .place.
.Counter-controlled .repetition .is .not .possible. .- .correct .answer.The .body .of .the .loop .will
.execute .at .least .once
The .____________, .__________ .and .____________ .are .the .only .three .forms .of .control
.necessary.
.
.for, .while, .do...while.
.sequence, .selection, .repetition.
.break, .continue, .if...else.
.switch, .if, .else. .- .correct .answer.sequence, .selection, .repetition
A .switch .statement .should .be .used:
.
.To .replace .all .if .and .if...else .statements.
.As .a .double-selection .structure.
.As .a .multiple-selection .structure.
.As .a .single-selection .structure. .- .correct .answer.As .a .multiple-selection .structure
A .reference .parameter:
.
. Is .declared .by .following .the .parameter's .type .in .the .function .prototype .by .an .ampersand
.(&).
.Cannot .be .modified.
.Both .(a) .and .(b).
.Is .an .alias .for .its .corresponding .argument. .- .correct .answer.Both .(a) .and .(b)
When .an .argument .is .passed-by-value, .changes .in .the .calling .function .__________
.affect .the .original .variable's .value; .when .an .argument .is .passed .call-by-reference,
.changes .__________ .affect .the .original .variable's .value.
.
.Do .not, .do.
.Do, .do.
.Do .not, .do .not.
.Do, .do .not. .- .correct .answer.Do .not, .do
Call-by-reference .can .achieve .the .security .of .call-by-value .when:
.
. The .const .qualifier .is .used.
. The .value .being .passed .is .small.
.A .pointer .to .the .argument .is .used.
.A .large .argument .is .passed .in .order .to .improve .performance. .- .correct .answer.The .const
.qualifier .is .used
Questions And Answers 2024
The .assignment .operator .________ .assigns .the .value .of .the .expression .on .its .right .to .the
.variable .on .its .left.
.
.->
.#
.=
.<- .- .correct .answer.=
The .data .type .bool:
.
.Can .take .on .values .-1, .0 .or .1.
.Can .take .on .any .expression .as .a .value.
.Can .only .be .used .in .a .selection .statement.
.Can .take .on .values .true .and .false. .- .correct .answer.Can .take .on .values .true .and .false
What .is .the .final .value .of .x .after .performing .the .following .operations? .
.int .x .= .21;
.double .y .= .6;
.double .z .= .14;
.y .= .x ./ .z;
.x .= .5.5 .* .y;
.
.5
.8
.5.5
.8.25 .- .correct .answer.8
If .a .do...while .structure .is .used:
.
The .body .of .the .loop .will .execute .at .least .once.
.
, . An .off-by-one .error .will .not .occur.
.An .infinite .loop .will .not .take .place.
.Counter-controlled .repetition .is .not .possible. .- .correct .answer.The .body .of .the .loop .will
.execute .at .least .once
The .____________, .__________ .and .____________ .are .the .only .three .forms .of .control
.necessary.
.
.for, .while, .do...while.
.sequence, .selection, .repetition.
.break, .continue, .if...else.
.switch, .if, .else. .- .correct .answer.sequence, .selection, .repetition
A .switch .statement .should .be .used:
.
.To .replace .all .if .and .if...else .statements.
.As .a .double-selection .structure.
.As .a .multiple-selection .structure.
.As .a .single-selection .structure. .- .correct .answer.As .a .multiple-selection .structure
A .reference .parameter:
.
. Is .declared .by .following .the .parameter's .type .in .the .function .prototype .by .an .ampersand
.(&).
.Cannot .be .modified.
.Both .(a) .and .(b).
.Is .an .alias .for .its .corresponding .argument. .- .correct .answer.Both .(a) .and .(b)
When .an .argument .is .passed-by-value, .changes .in .the .calling .function .__________
.affect .the .original .variable's .value; .when .an .argument .is .passed .call-by-reference,
.changes .__________ .affect .the .original .variable's .value.
.
.Do .not, .do.
.Do, .do.
.Do .not, .do .not.
.Do, .do .not. .- .correct .answer.Do .not, .do
Call-by-reference .can .achieve .the .security .of .call-by-value .when:
.
. The .const .qualifier .is .used.
. The .value .being .passed .is .small.
.A .pointer .to .the .argument .is .used.
.A .large .argument .is .passed .in .order .to .improve .performance. .- .correct .answer.The .const
.qualifier .is .used