PROGRAMMING AND PROBLEM-
SOLVING FINAL EXAM QUESTIONS
AND CORRECT ANSWERS
WhatA2doesA2aA2breakA2statementA2inA2aA2switchA2do?A2-A2Ans--
ItA2breaksA2theA2programA2outA2ofA2theA2currentA2loopA2(butA2doesn'tA2stopA2it).
WhichA2loopA2alwaysA2executesA2codeA2atA2leastA2once?A2-A2Ans--Do-WhileA2loops.
IfA2noneA2ofA2theA2casesA2areA2matchedA2inA2aA2switchA2statement,A2whatA2codeA2isA2exec
uted?A2-A2Ans--Default.
WhatA2isA2aA2true/falseA2statementA2called?A2-A2Ans--AA2Boolean.
VariablesA2shouldA2alwaysA2beA2___A2beforeA2theA2programA2attemptsA2toA2useA2theirA2val
ue.A2-A2Ans--Initialized.
ThisA2statementA2mayA2notA2executeA2theA2bodyA2ofA2aA2loopA2atA2all.A2-A2Ans--While.
AllA2numericA2constantsA2inA2aA2programA2shouldA2beA2embeddedA2asA2___.A2-A2Ans--
Variables.
WhoA2wasA2AdaA2Lovelace?A2WhatA2didA2sheA2contributeA2toA2computerA2science?A2-
A2Ans--
SheA2wasA2theA2daughterA2ofA2LordA2Byron.A2SheA2wroteA2theA2firstA2programA2forA2Charle
sA2Babbage'sA2computer.
WhatA2isA2theA2differenceA2betweenA2aA2machineA2languageA2programA2andA2aA2high-
levelA2languageA2program?A2-A2Ans--Machine-
levelA2languagesA2useA2binaryA2orA2bytesA2thatA2aA2CPUA2willA2understand.
High-
levelA2languagesA2canA2beA2understoodA2byA2humansA2andA2translatedA2intoA2binaryA2thro
ughA2aA2compiler.
WhatA2purposeA2doesA2anA2operatingA2systemA2serve?A2-A2Ans--
OperatingA2systemsA2areA2highly-abstracted,A2user-
friendlyA2interfacesA2whichA2canA2runA2applications.
WhatA2isA2theA2roleA2ofA2theA2compiler?A2-A2Ans--ItA2translatesA2high-
levelA2languagesA2toA2machineA2language.
SOLVING FINAL EXAM QUESTIONS
AND CORRECT ANSWERS
WhatA2doesA2aA2breakA2statementA2inA2aA2switchA2do?A2-A2Ans--
ItA2breaksA2theA2programA2outA2ofA2theA2currentA2loopA2(butA2doesn'tA2stopA2it).
WhichA2loopA2alwaysA2executesA2codeA2atA2leastA2once?A2-A2Ans--Do-WhileA2loops.
IfA2noneA2ofA2theA2casesA2areA2matchedA2inA2aA2switchA2statement,A2whatA2codeA2isA2exec
uted?A2-A2Ans--Default.
WhatA2isA2aA2true/falseA2statementA2called?A2-A2Ans--AA2Boolean.
VariablesA2shouldA2alwaysA2beA2___A2beforeA2theA2programA2attemptsA2toA2useA2theirA2val
ue.A2-A2Ans--Initialized.
ThisA2statementA2mayA2notA2executeA2theA2bodyA2ofA2aA2loopA2atA2all.A2-A2Ans--While.
AllA2numericA2constantsA2inA2aA2programA2shouldA2beA2embeddedA2asA2___.A2-A2Ans--
Variables.
WhoA2wasA2AdaA2Lovelace?A2WhatA2didA2sheA2contributeA2toA2computerA2science?A2-
A2Ans--
SheA2wasA2theA2daughterA2ofA2LordA2Byron.A2SheA2wroteA2theA2firstA2programA2forA2Charle
sA2Babbage'sA2computer.
WhatA2isA2theA2differenceA2betweenA2aA2machineA2languageA2programA2andA2aA2high-
levelA2languageA2program?A2-A2Ans--Machine-
levelA2languagesA2useA2binaryA2orA2bytesA2thatA2aA2CPUA2willA2understand.
High-
levelA2languagesA2canA2beA2understoodA2byA2humansA2andA2translatedA2intoA2binaryA2thro
ughA2aA2compiler.
WhatA2purposeA2doesA2anA2operatingA2systemA2serve?A2-A2Ans--
OperatingA2systemsA2areA2highly-abstracted,A2user-
friendlyA2interfacesA2whichA2canA2runA2applications.
WhatA2isA2theA2roleA2ofA2theA2compiler?A2-A2Ans--ItA2translatesA2high-
levelA2languagesA2toA2machineA2language.