Solution and Answer Guide #z #z #z
Farrell, #zJava #zProgramming #z10e, #z[978-035-767-3423], #zChapter #z1: #zCreating #zJava #zPrograms
Table of Contents
#z #z
Review #zQuestions #zAnswers ......................................................................................................................... 1
Programming #zExercises #zSolutions ............................................................................................................... 7
Debugging #zExercises #zSolutions ................................................................................................................. 13
Game #zZone #zSolutions ................................................................................................................................ 14
Case #zProblems #zSolutions ........................................................................................................................... 16
Review Questions Answers
#z #z
1. The #zmost #zbasic #zcircuitry-level #zcomputer #zlanguage #zis #z .
a. machine #zlanguage
b. Java
c. high-level #zlanguage
d. C++
Answer: #za
Feedback:
The #zmost #zbasic #zcircuitry-level #zcomputer #zlanguage #zis #zmachine #zlanguage. #zMachine #zlanguage, #zor
#zmachine #zcode, #zis #zthe #zmost #zbasic #zset #zof #zinstructions #za #zcomputer #zcan #zexecute. #zJava #zand
#zC++ #zare #zboth #zhigh-level #zlanguages #zand #zare #zthe #zopposite #zof #zcircuitry-level #zcomputer
#zlanguage.
2. Languages #zthat #zlet #zyou #zuse #zan #zeasily #zunderstood #zvocabulary #zof #zdescriptive #zterms, #zsuch #zas #zread, #zwrite,
#zor #zadd, #zare #zknown #zas #z languages.
a. procedural
b. high-level
c. machine
d. object-oriented
Answer: #zb
Feedback:
High-level #zlanguages #zuse #zEnglish-like #zterms; #zJava #zis #zan #zexample #zof #za #zhigh-level #zlanguage.
#zProcedural #zlanguages #zare #zthose #zthat #zrun #zby #zexecuting #za #zseries #zof #zprocedures #zor #zmethods.
#zMachine-level #zlanguages #zdo #znot #zuse #zEnglish-like #zterms; #zthey #zuse #z1s #zand #z0s. #zObject-
oriented #zlanguages #zare #zrun #zby #zdeclaring #zand #zusing #zobjects #zthat #zcontain #zdata #zand #zmethods.
© 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible 1
website, in whole or in part.
, Solution and Answer Guide: Farrell, Java Programming 10e, [978-035-767-3423], Chapter 1: Creating Java Programs
3. The #zrules #zof #za #zprogramming #zlanguage #zconstitute #zits #z .
a. syntax
b. logic
c. format
d. objects
Answer: #za
Feedback:
The #zrules #zof #za #zprogramming #zlanguage #zconstitute #zits #zsyntax.
4. A #z translates #zhigh-level #zlanguage #zstatements #zinto #zmachine #zcode.
a. programmer
b. syntax #zdetector
c. compiler
d. decipherer
Answer: #zc
Feedback:
A #zcompiler #ztranslates #zhigh-level #zlanguage #zstatements #zinto #zmachine #zcode. #zA #zprogrammer
#z writes #zhigh- #zlevel #zlanguage #zstatements #zbut #zdoes #znot #ztranslate #zthem. #z“Syntax #zdetector” #zand
#z“decipherer” #zare #znot #zterms #zused #zin #zprogramming.
5. Named #zcomputer #zmemory #zlocations #zare #zcalled #z .
a. compilers
b. variables
c. addresses
d. appellations
Answer: #zb
Feedback:
Named #zcomputer #zmemory #zlocations #zare #zvariables. #zCompilers #ztranslate #zprogramming #zstatements
#zinto #zmachine #zlanguage; #zthey #zare #znot #zmemory #zlocations. #zAddresses #zare #zunnamed #zcomputer
#zmemory #zlocations. #z“Appellations” #zis #znot #za #zterm #zused #zin #zprogramming.
6. The #zindividual #zoperations #zused #zin #za #zcomputer #zprogram #zare #zoften #zgrouped #zinto #zlogical #zunits #zcalled
.
a. procedures
b. variables
© 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible 2
website, in whole or in part.
, Solution and Answer Guide: Farrell, Java Programming 10e, [978-035-767-3423], Chapter 1: Creating Java Programs
c. constants
d. logistics
Answer: #za
Feedback:
The #zindividual #zoperations #zused #zin #za #zcomputer #zprogram #zare #zoften #zgrouped #zinto #zlogical #zunits
#zcalled #zprocedures. #zVariables #zare #znamed #zmemory #zlocations, #zand #zconstants #zare #zvalues #zthat #zdo
#znot #zchange; #zthey #zare #znot #zgroups #zof #zlogical #zoperations. #z“Logistics” #zis #znot #za #zterm
#zcommonly #zused #zin #zprogramming.
7. Envisioning #zprogram #zcomponents #zas #zobjects #zthat #zare #zsimilar #zto #zconcrete #zobjects #zin #zthe #zreal #zworld #zis
#z the #zhallmark #zof #z .
a. command-line #zoperating #zsystems
b. procedural #zprogramming
c. object-oriented # z programming
d. machine #zlanguages
Answer: #zc
Feedback:
Envisioning #zprogram #zcomponents #zas #zobjects #zthat #zare #zsimilar #zto #zconcrete #zobjects #zin #zthe #zreal
#zworld #zis #zthe #zhallmark #zof #zobject-oriented #zprogramming.
8. The #zvalues #zof #zan #zobject’s #zattributes #zare #zknown #zas #zits #z .
a. state
b. orientation
c. methods
d. condition
Answer: #za
Feedback:
The #zvalues #zof #zan #zobject’s #zattributes #zare #zknown #zas #zits #zstate.
9. An #zinstance #zof #za #zclass #zis #za(n) #z .
a. method
b. procedure
c. object
d. case
Answer: #zc
© 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible 3
website, in whole or in part.
, Solution and Answer Guide: Farrell, Java Programming 10e, [978-035-767-3423], Chapter 1: Creating Java Programs
Feedback:
An #zinstance #zof #za #zclass #zis #zan #zobject.
10. Java #zis #zarchitecturally #z .
a. neutral
b. oriented
c. specific
d. abstract
Answer: #za
Feedback:
Java #zis #zarchitecturally #zneutral.
11. You #zmust #zcompile #zclasses #zwritten #zin #zJava #zinto #z .
a. bytecode
b. source #zcode
c. Javadoc #zstatements
d. object #zcode
Answer: #za
Feedback:
You #zmust #zcompile #zclasses #zwritten #zin #zJava #zinto #zbytecode. # z Source #zcode #zis #zthe #zhigh-level
#zprogramming #zstatements. #zJavadoc #zstatements #zare #za #ztype #zof #zcomment #zused #zfor #zdocumentation.
#zObject #zcode #zis #zthe #zlow- #zlevel #zcode #zproduced #z when #za #zcompiler #ztranslates #zhigh-level #zcode.
12. All #zJava #zprogramming #zstatements #zmust #zend #zwith #za #z .
a. period
b. comma
c. closing #zparenthesis
d. semicolon
Answer: #zd
Feedback:
All #zJava #zprogramming #zstatements #zmust #zend #zwith #za #zsemicolon.
13. Arguments #zto #zmethods #zalways #zappear #zwithin #z .
a. parentheses
b. double #zquotation #zmarks
© 2022 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible 4
website, in whole or in part.