CS4303 - EXAM 1, CS4303 - EXAM 2,
4102 CHAPTER 6, 4102 CHAPTER 7
QUESTIONS AND CORRECT
ANSWERS
ThreadsA2inA2JavaA2areA2anA2exampleA2ofA2____.
SelectA2one:
a.A2basicA2controlA2abstractions
b.A2unitA2controlA2abstractionsA2
c.A2basicA2dataA2abstractions
d.A2structuredA2controlA2abstractionsA2-A2Ans--b.A2UnitA2controlA2abstractions
TheA2____A2programmingA2paradigmA2hasA2achievedA2widespreadA2useA2overA2theA2lastA
220A2years.
SelectA2one:
a.A2logic
b.A2object-oriented
c.A2functional
d.A2assemblerA2-A2Ans--b.A2Object-oriented
TheA2____A2abstractionA2isA2oftenA2associatedA2withA2theA2conceptA2ofA2anA2abstractA2dat
aA2type.
SelectA2one:
a.A2structuredA2control
b.A2unitA2data
c.A2basicA2data
d.A2structuredA2dataA2-A2Ans--b.A2UnitA2data
VariablesA2areA2givenA2namesA2andA2dataA2typesA2usingA2aA2____.
SelectA2one:
a.A2declarationA2
b.A2function
c.A2package
d.A2structureA2-A2Ans--a.A2declaration
TheA2lambdaA2calculusA2wasA2basedA2onA2theA2theoryA2ofA2recursiveA2functionsA2(T/F)A2-
A2Ans--True
TheA2syntaxA2ofA2aA2programmingA2languageA2refersA2toA2itsA2meaningA2(T/F)A2-A2Ans--
False
,AA2linkerA2programA2isA2usedA2toA2loadA2machineA2codeA2intoA2computerA2memoryA2(T/
F)A2-A2Ans--False
SpecificationA2languagesA2wouldA2allowA2usersA2toA2indicateA2theirA2requirementsA2andA2
wouldA2thenA2implementA2thoseA2requirementsA2(T/F)A2-A2Ans--True
WhichA2ofA2theA2followingA2statementsA2aboutA2aA2programmingA2languageA2isA2correct?
SelectA2one:
a.A2SemanticsA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2abstractionA2refersA
2toA2theA2meaningA2ofA2theA2language.
b.A2SyntaxA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2abstractionA2refersA2toA
2theA2meaningA2ofA2theA2language.
c.A2SyntaxA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2semanticsA2refersA2toA2t
heA2meaningA2ofA2theA2language.
d.A2SemanticsA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2syntaxA2refersA2toA2t
heA2meaningA2ofA2theA2language.A2-A2Ans--
c.A2SyntaxA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2semanticsA2refersA2toA2t
heA2meaningA2ofA2theA2language.
TheA2lexicalA2structureA2ofA2aA2programmingA2languageA2isA2similarA2toA2theA2____A2inA2aA
2naturalA2language
SelectA2one:
a.A2syntax
b.A2grammar
c.A2spelling
d.A2semanticsA2-A2Ans--c.A2Spelling
AA2____A2isA2anA2objectA2associatedA2withA2aA2collection,A2andA2isA2usedA2toA2visitA2eachA2
elementA2inA2theA2collection.
SelectA2one:
a.A2iterator
b.A2invocator
c.A2interpreter
d.A2argumentA2-A2Ans--a.A2Iterator
BeforeA2theA2middleA2ofA2theA21940s,A2computerA2operatorsA2hardwireA2theirA2programsA2
byA2settingA2switchesA2thatA2adjustedA2theA2internalA2wiringA2ofA2theA2computer.A2(T/F)A2-
A2Ans--True
____A2abstractionsA2supportA2informationA2hiding.
SelectA2one:
a.A2UnitA2data
b.A2StructuredA2control
c.A2BasicA2data
d.A2StructuredA2dataA2-A2Ans--a.A2UnitA2data
,InA2aA2program,A2selectionA2andA2iterationA2areA2accomplishedA2byA2theA2useA2ofA2____.
SelectA2one:
a.A2syntacticA2sugar
b.A2applicationA2programmingA2interfaces
c.A2branchA2instructions
d.A2structuredA2dataA2abstractionsA2-A2Ans--c.A2branchA2instructions
AA2programmingA2language'sA2wordsA2areA2referredA2toA2asA2tokens.A2(T/F)A2-A2Ans--True
AnA2abstractionA2isA2aA2wayA2ofA2expressingA2ideasA2thatA2makeA2theA2concise,A2simple,A2
andA2easyA2forA2theA2humanA2mindA2toA2grasp.A2(T/F)A2-A2Ans--True
TheA2FORTRANA2languageA2providedA2supportA2forA2algebraicA2notationA2andA2floating-
pointA2numbers.A2(T/F)A2-A2Ans--True
TheA2'if'A2formA2inA2SchemeA2isA2likeA2anA2if-elseA2construct.A2(T/F)A2-A2Ans--True
'hd'A2isA2theA2predifinedA2listA2functionA2thatA2returnsA2theA2headA2ofA2aA2listA2inA2Scheme.A
2(T/F)A2-A2Ans--False
InA2Scheme,A2aA2'let'A2specialA2formA2canA2beA2usedA2toA2defineA2aA2recursiveA2function.A2
(T/F)A2-A2Ans--False
TheA2definitionA2ofA2aA2languageA2usingA2anA2interpreterA2writtenA2inA2theA2sameA2languag
eA2isA2calledA2aA2_____A2.A2-A2Ans--MetacircularA2interpreter
InA2lambdaA2calculus,A2aA2valueA2canA2beA2substitutedA2forA2aA2variableA2byA2useA2ofA2a(n
)A2____.
a)A2reductionA2rule
b)A2evaluationA2rule
c)A2abstractionA2rule
d)A2applicationA2ruleA2-A2Ans--a.A2ReductionA2rule
SchemeA2expressionsA2thatA2beginA2withA2keywordsA2areA2calledA2controlA2forms.A2(T/
F)A2-A2Ans--False
WhichA2ofA2theA2followingA2statementsA2aboutA2lazyA2evaluationA2isA2incorrect?
SelectA2one:
a.A2AllA2argumentsA2toA2user-definedA2functionsA2areA2delayed.
b.A2AllA2argumentsA2toA2constructorA2functionsA2areA2delayed.
c.A2OperationsA2onA2listsA2mustA2evaluateA2theA2entireA2list.
, d.A2AllA2bindingsA2ofA2localA2namesA2inA2letA2andA2letrecA2expressionsA2areA2delayed.A2-
A2Ans--c.A2OperationsA2onA2listsA2mustA2evaluateA2theA2entireA2list.
GivenA2aA2listA2LA2inA2SchemeA2withA2contentsA2ofA2((xA2y)A2sA2(t)).A2WhatA2willA2beA2return
edA2ifA2theA2commandA2(cdrA2(carA2L))A2isA2executed?
SelectA2one:
a.(y)
b.(x)
c.(xA2y)
d.(t)A2-A2Ans--a.A2(y)
TheA2'rand'A2functionA2isA2referentiallyA2transparent.A2(T/F)A2-A2Ans--False
AA2SchemeA2compilerA2willA2translateA2aA2tailA2recursiveA2functionA2intoA2codeA2thatA2exec
utesA2asA2aA2loop.A2(T/F)A2-A2Ans--True
SchemeA2expressionsA2mustA2beA2writtenA2inA2prefixA2form.A2(T/F)A2-A2Ans--True
WhichA2ofA2theA2followingA2correctlyA2assignsA2valuesA2toA2twoA2variablesA2andA2thenA2mu
ltipliesA2themA2inA2theA2SchemeA2programmingA2language?
a.A2(letA2((xA25)A2(yA23))A2(*A2xA2y))
b.A2(letA2(xA25)A2(yA23))A2(*A2xA2y)
c.A2letA2(xA25)A2(yA23)A2(*A2xA2y)
d.A2(letA2(xA25A2yA23)A2(*A2xA2y))A2-A2Ans--a.A2(letA2((xA25)(yA23))A2(*A2xA2y))
WhichA2ofA2theA2followingA2SchemeA2statementsA2willA2insertA2theA2numberA26A2atA2theA2h
eadA2ofA2aA2listA2namedA2L?
a.A2(addA26A2L)
b.A2(insertA26A2L)
c.A2(hdA26A2L)
4102 CHAPTER 6, 4102 CHAPTER 7
QUESTIONS AND CORRECT
ANSWERS
ThreadsA2inA2JavaA2areA2anA2exampleA2ofA2____.
SelectA2one:
a.A2basicA2controlA2abstractions
b.A2unitA2controlA2abstractionsA2
c.A2basicA2dataA2abstractions
d.A2structuredA2controlA2abstractionsA2-A2Ans--b.A2UnitA2controlA2abstractions
TheA2____A2programmingA2paradigmA2hasA2achievedA2widespreadA2useA2overA2theA2lastA
220A2years.
SelectA2one:
a.A2logic
b.A2object-oriented
c.A2functional
d.A2assemblerA2-A2Ans--b.A2Object-oriented
TheA2____A2abstractionA2isA2oftenA2associatedA2withA2theA2conceptA2ofA2anA2abstractA2dat
aA2type.
SelectA2one:
a.A2structuredA2control
b.A2unitA2data
c.A2basicA2data
d.A2structuredA2dataA2-A2Ans--b.A2UnitA2data
VariablesA2areA2givenA2namesA2andA2dataA2typesA2usingA2aA2____.
SelectA2one:
a.A2declarationA2
b.A2function
c.A2package
d.A2structureA2-A2Ans--a.A2declaration
TheA2lambdaA2calculusA2wasA2basedA2onA2theA2theoryA2ofA2recursiveA2functionsA2(T/F)A2-
A2Ans--True
TheA2syntaxA2ofA2aA2programmingA2languageA2refersA2toA2itsA2meaningA2(T/F)A2-A2Ans--
False
,AA2linkerA2programA2isA2usedA2toA2loadA2machineA2codeA2intoA2computerA2memoryA2(T/
F)A2-A2Ans--False
SpecificationA2languagesA2wouldA2allowA2usersA2toA2indicateA2theirA2requirementsA2andA2
wouldA2thenA2implementA2thoseA2requirementsA2(T/F)A2-A2Ans--True
WhichA2ofA2theA2followingA2statementsA2aboutA2aA2programmingA2languageA2isA2correct?
SelectA2one:
a.A2SemanticsA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2abstractionA2refersA
2toA2theA2meaningA2ofA2theA2language.
b.A2SyntaxA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2abstractionA2refersA2toA
2theA2meaningA2ofA2theA2language.
c.A2SyntaxA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2semanticsA2refersA2toA2t
heA2meaningA2ofA2theA2language.
d.A2SemanticsA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2syntaxA2refersA2toA2t
heA2meaningA2ofA2theA2language.A2-A2Ans--
c.A2SyntaxA2refersA2toA2theA2structureA2ofA2theA2language,A2whileA2semanticsA2refersA2toA2t
heA2meaningA2ofA2theA2language.
TheA2lexicalA2structureA2ofA2aA2programmingA2languageA2isA2similarA2toA2theA2____A2inA2aA
2naturalA2language
SelectA2one:
a.A2syntax
b.A2grammar
c.A2spelling
d.A2semanticsA2-A2Ans--c.A2Spelling
AA2____A2isA2anA2objectA2associatedA2withA2aA2collection,A2andA2isA2usedA2toA2visitA2eachA2
elementA2inA2theA2collection.
SelectA2one:
a.A2iterator
b.A2invocator
c.A2interpreter
d.A2argumentA2-A2Ans--a.A2Iterator
BeforeA2theA2middleA2ofA2theA21940s,A2computerA2operatorsA2hardwireA2theirA2programsA2
byA2settingA2switchesA2thatA2adjustedA2theA2internalA2wiringA2ofA2theA2computer.A2(T/F)A2-
A2Ans--True
____A2abstractionsA2supportA2informationA2hiding.
SelectA2one:
a.A2UnitA2data
b.A2StructuredA2control
c.A2BasicA2data
d.A2StructuredA2dataA2-A2Ans--a.A2UnitA2data
,InA2aA2program,A2selectionA2andA2iterationA2areA2accomplishedA2byA2theA2useA2ofA2____.
SelectA2one:
a.A2syntacticA2sugar
b.A2applicationA2programmingA2interfaces
c.A2branchA2instructions
d.A2structuredA2dataA2abstractionsA2-A2Ans--c.A2branchA2instructions
AA2programmingA2language'sA2wordsA2areA2referredA2toA2asA2tokens.A2(T/F)A2-A2Ans--True
AnA2abstractionA2isA2aA2wayA2ofA2expressingA2ideasA2thatA2makeA2theA2concise,A2simple,A2
andA2easyA2forA2theA2humanA2mindA2toA2grasp.A2(T/F)A2-A2Ans--True
TheA2FORTRANA2languageA2providedA2supportA2forA2algebraicA2notationA2andA2floating-
pointA2numbers.A2(T/F)A2-A2Ans--True
TheA2'if'A2formA2inA2SchemeA2isA2likeA2anA2if-elseA2construct.A2(T/F)A2-A2Ans--True
'hd'A2isA2theA2predifinedA2listA2functionA2thatA2returnsA2theA2headA2ofA2aA2listA2inA2Scheme.A
2(T/F)A2-A2Ans--False
InA2Scheme,A2aA2'let'A2specialA2formA2canA2beA2usedA2toA2defineA2aA2recursiveA2function.A2
(T/F)A2-A2Ans--False
TheA2definitionA2ofA2aA2languageA2usingA2anA2interpreterA2writtenA2inA2theA2sameA2languag
eA2isA2calledA2aA2_____A2.A2-A2Ans--MetacircularA2interpreter
InA2lambdaA2calculus,A2aA2valueA2canA2beA2substitutedA2forA2aA2variableA2byA2useA2ofA2a(n
)A2____.
a)A2reductionA2rule
b)A2evaluationA2rule
c)A2abstractionA2rule
d)A2applicationA2ruleA2-A2Ans--a.A2ReductionA2rule
SchemeA2expressionsA2thatA2beginA2withA2keywordsA2areA2calledA2controlA2forms.A2(T/
F)A2-A2Ans--False
WhichA2ofA2theA2followingA2statementsA2aboutA2lazyA2evaluationA2isA2incorrect?
SelectA2one:
a.A2AllA2argumentsA2toA2user-definedA2functionsA2areA2delayed.
b.A2AllA2argumentsA2toA2constructorA2functionsA2areA2delayed.
c.A2OperationsA2onA2listsA2mustA2evaluateA2theA2entireA2list.
, d.A2AllA2bindingsA2ofA2localA2namesA2inA2letA2andA2letrecA2expressionsA2areA2delayed.A2-
A2Ans--c.A2OperationsA2onA2listsA2mustA2evaluateA2theA2entireA2list.
GivenA2aA2listA2LA2inA2SchemeA2withA2contentsA2ofA2((xA2y)A2sA2(t)).A2WhatA2willA2beA2return
edA2ifA2theA2commandA2(cdrA2(carA2L))A2isA2executed?
SelectA2one:
a.(y)
b.(x)
c.(xA2y)
d.(t)A2-A2Ans--a.A2(y)
TheA2'rand'A2functionA2isA2referentiallyA2transparent.A2(T/F)A2-A2Ans--False
AA2SchemeA2compilerA2willA2translateA2aA2tailA2recursiveA2functionA2intoA2codeA2thatA2exec
utesA2asA2aA2loop.A2(T/F)A2-A2Ans--True
SchemeA2expressionsA2mustA2beA2writtenA2inA2prefixA2form.A2(T/F)A2-A2Ans--True
WhichA2ofA2theA2followingA2correctlyA2assignsA2valuesA2toA2twoA2variablesA2andA2thenA2mu
ltipliesA2themA2inA2theA2SchemeA2programmingA2language?
a.A2(letA2((xA25)A2(yA23))A2(*A2xA2y))
b.A2(letA2(xA25)A2(yA23))A2(*A2xA2y)
c.A2letA2(xA25)A2(yA23)A2(*A2xA2y)
d.A2(letA2(xA25A2yA23)A2(*A2xA2y))A2-A2Ans--a.A2(letA2((xA25)(yA23))A2(*A2xA2y))
WhichA2ofA2theA2followingA2SchemeA2statementsA2willA2insertA2theA2numberA26A2atA2theA2h
eadA2ofA2aA2listA2namedA2L?
a.A2(addA26A2L)
b.A2(insertA26A2L)
c.A2(hdA26A2L)