#ghCreating #ghJava #ghPrograms
Solution and Answer Guide #gh #gh #gh
Farrell, #ghJava #ghProgramming #gh10e, #gh[978-035-767-3423], #ghChapter #gh1: #ghCreating #ghJava #ghPrograms
Table of Contents
#gh #gh
Review #ghQuestions #ghAnswers ....................................................................................................................... 1
Programming #ghExercises #ghSolutions.............................................................................................................. 7
Debugging #ghExercises #ghSolutions ............................................................................................................... 13
Game #ghZone #ghSolutions .............................................................................................................................. 14
Case #ghProblems #ghSolutions ......................................................................................................................... 16
Review Questions Answers
#gh #gh
1. The #ghmost #ghbasic #ghcircuitry-level #ghcomputer #ghlanguage #ghis #gh .
a. machine #ghlanguage
b. Java
c. high-level #ghlanguage
d. C++
Answer: #gha
Feedback:
The #ghmost #ghbasic #ghcircuitry-level #ghcomputer #ghlanguage #ghis #ghmachine #ghlanguage. #ghMachine
#ghlanguage, #ghor #ghmachine #ghcode, #ghis #ghthe #ghmost #ghbasic #ghset #ghof #ghinstructions #gha #ghcomputer #ghcan
#ghexecute. #ghJava #ghand #ghC++ #ghare #ghboth #ghhigh-level #ghlanguages #ghand #ghare #ghthe #ghopposite #ghof
#ghcircuitry-level #ghcomputer #ghlanguage.
2. Languages #ghthat #ghlet #ghyou #ghuse #ghan #gheasily #ghunderstood #ghvocabulary #ghof #ghdescriptive #ghterms, #ghsuch #ghas
#gh read, #ghwrite, #ghor #ghadd, #ghare #ghknown #ghas #gh languages.
a. procedural
b. high-level
c. machine
d. object-oriented
Answer: #ghb
Feedback:
High-level #ghlanguages #ghuse #ghEnglish-like #ghterms; #ghJava #ghis #ghan #ghexample #ghof #gha #ghhigh-level
#ghlanguage. #ghProcedural #ghlanguages #ghare #ghthose #ghthat #ghrun #ghby #ghexecuting #gha #ghseries #ghof
#ghprocedures #ghor #ghmethods. #ghMachine-level #ghlanguages #ghdo #ghnot #ghuse #ghEnglish-like #ghterms; #ghthey
#ghuse #gh1s #ghand #gh0s. #ghObject-oriented #ghlanguages #ghare #ghrun #ghby #ghdeclaring #ghand #ghusing #ghobjects
#ghthat #ghcontain #ghdata #ghand #ghmethods.
© #gh2022 #ghCengage. #ghAll #ghRights #ghReserved. #ghMay #ghnot #ghbe #ghscanned, #ghcopied #ghor #ghduplicated, #ghor 1
posted#gh
website,
#gh into#gh#gh
#gh a #ghpublicly
whole #ghor #ghaccessible
#ghin #ghpart. SCHOLARVAULT
, Solution #ghand #ghAnswer #ghGuide: #ghFarrell, #ghJava #ghProgramming #gh10e, #gh[978-035-767-3423], #ghChapter #gh1:
#ghCreating #ghJava #ghPrograms
3. The rules of a programming language constitute its .
a. syntax
b. logic
c. format
d. objects
Answer: a
Feedback:
The rules of a programming language constitute its syntax.
4. A translates high-level language statements into machine code.
a. programmer
b. syntax detector
c. compiler
d. decipherer
Answer: c
Feedback:
A compiler translates high-level language statements into machine code. A programmer writes high-
level language statements but does not translate them. “Syntax detector” and “decipherer” are not
terms used in programming.
5. Named computer memory locations are called .
a. compilers
b. variables
c. addresses
d. appellations
Answer: b
Feedback:
Named computer memory locations are variables. Compilers translate programming statements into
machine language; they are not memory locations. Addresses are unnamed computer memory
locations. “Appellations” is not a term used in programming.
6. The individual operations used in a computer program are often grouped into logical units called
.
a. procedures
b. variables
© #gh2022 #ghCengage. #ghAll #ghRights #ghReserved. #ghMay #ghnot #ghbe #ghscanned, #ghcopied #ghor #ghduplicated, #ghor 2
posted#gh
website,
#gh into#gh#gh
#gh a #ghpublicly
whole #ghor #ghaccessible
#ghin #ghpart. SCHOLARVAULT
, Solution #ghand #ghAnswer #ghGuide: #ghFarrell, #ghJava #ghProgramming #gh10e, #gh[978-035-767-3423], #ghChapter #gh1:
#ghCreating #ghJava #ghPrograms
c. constants
d. logistics
Answer: #gha
Feedback:
The #ghindividual #ghoperations #ghused #ghin #gha #ghcomputer #ghprogram #ghare #ghoften #ghgrouped #ghinto
#ghlogical #ghunits #ghcalled #ghprocedures. #ghVariables #ghare #ghnamed #ghmemory #ghlocations, #ghand #ghconstants
#ghare #ghvalues #ghthat #ghdo #ghnot #ghchange; #ghthey #ghare #ghnot #ghgroups #ghof #ghlogical #ghoperations.
#gh“Logistics” #ghis #ghnot #gha #ghterm #ghcommonly #ghused #ghin #ghprogramming.
7. Envisioning #ghprogram #ghcomponents #ghas #ghobjects #ghthat #ghare #ghsimilar #ghto #ghconcrete #ghobjects #ghin #ghthe #ghreal
#ghworld #ghis #ghthe #ghhallmark #ghof #gh .
a. command-line #ghoperating #ghsystems
b. procedural #ghprogramming
c. object-oriented # g h programming
d. machine #ghlanguages
Answer: #ghc
Feedback:
Envisioning #ghprogram #ghcomponents #ghas #ghobjects #ghthat #ghare #ghsimilar #ghto #ghconcrete #ghobjects #ghin
#ghthe #ghreal #ghworld #ghis #ghthe #ghhallmark #ghof #ghobject-oriented #ghprogramming.
8. The #ghvalues #ghof #ghan #ghobject’s #ghattributes #ghare #ghknown #ghas #ghits #gh .
a. state
b. orientation
c. methods
d. condition
Answer: #gha
Feedback:
The #ghvalues #ghof #ghan #ghobject’s #ghattributes #ghare #ghknown #ghas #ghits #ghstate.
9. An #ghinstance #ghof #gha #ghclass #ghis #gha(n) #gh .
a. method
b. procedure
c. object
d. case
Answer: #ghc
© #gh2022 #ghCengage. #ghAll #ghRights #ghReserved. #ghMay #ghnot #ghbe #ghscanned, #ghcopied #ghor #ghduplicated, #ghor 3
posted#gh
website,
#gh into#gh#gh
#gh a #ghpublicly
whole #ghor #ghaccessible
#ghin #ghpart. SCHOLARVAULT
, Solution #ghand #ghAnswer #ghGuide: #ghFarrell, #ghJava #ghProgramming #gh10e, #gh[978-035-767-3423], #ghChapter #gh1:
#ghCreating #ghJava #ghPrograms
Feedback:
An #ghinstance #ghof #gha #ghclass #ghis #ghan #ghobject.
10. Java #ghis #gharchitecturally #gh .
a. neutral
b. oriented
c. specific
d. abstract
Answer: #gha
Feedback:
Java #ghis #gharchitecturally #ghneutral.
11. You #ghmust #ghcompile #ghclasses #ghwritten #ghin #ghJava #ghinto #gh .
a. bytecode
b. source #ghcode
c. Javadoc #ghstatements
d. object #ghcode
Answer: #gha
Feedback:
You #ghmust #ghcompile #ghclasses #ghwritten #ghin #ghJava #ghinto #ghbytecode. # g h Source #ghcode #ghis #ghthe
#ghhigh-level #ghprogramming #ghstatements. #ghJavadoc #ghstatements #ghare #gha #ghtype #ghof #ghcomment #ghused
#ghfor #ghdocumentation. #ghObject #ghcode #ghis #ghthe #ghlow- #ghlevel #ghcode #ghproduced #ghwhen #gha #ghcompiler
#ghtranslates #ghhigh-level #ghcode.
12. All #ghJava #ghprogramming #ghstatements #ghmust #ghend #ghwith #gha #gh .
a. period
b. comma
c. closing #ghparenthesis
d. semicolon
Answer: #ghd
Feedback:
All #ghJava #ghprogramming #ghstatements #ghmust #ghend #ghwith #gha #ghsemicolon.
13. Arguments #ghto #ghmethods #ghalways #ghappear #ghwithin #gh .
a. parentheses
b. double #ghquotation #ghmarks
© #gh2022 #ghCengage. #ghAll #ghRights #ghReserved. #ghMay #ghnot #ghbe #ghscanned, #ghcopied #ghor #ghduplicated, #ghor 4
posted#gh
website,
#gh into#gh#gh
#gh a #ghpublicly
whole #ghor #ghaccessible
#ghin #ghpart. SCHOLARVAULT