Starting Out With C++ From Control Structures To Objects
,Test Bank & Solution Manual For Starting Out With C++ From Control Structures To Objects, 10th Edition By
Tony Gaddis
Starting Out With C++ From Control Structures To Objects, 10e (Gaddis)
Chapter 1 Introduction To Computers And Programming
True/False
1. Software Engineering Is A Field That Encompasses Designing, Writing, Testing, Debugging,
Documenting, Modifying, And Maintaining Computer Programs.
Answer: T
2. Pseudocode Is A Form Of A Program Statement That Will Always Evaluate To "False."
Answer: F
3. In Programming, The Terms "Line" And "Statement" Always Mean The Same Thing.
Answer: F
4. In C++, Key Words Are Written In All Lowercase Letters.
Answer: T
5. The Preprocessor Executes After The Compiler.
Answer: F
6. Machine Language Is An Example Of A High-Level Language.
Answer: F
7. A Cpu Only Understands Machine Language Instructions.
Answer: T
8. Programs Are Often Referred To As Hardware.
Answer: F
9. The Cpu Is The Most Important Component In A Computer Because Without It, The Computer
Could Not Run Software.
Answer: T
10. The Term "Bit" Stands For Binary Digit.
Answer: T
,Multiple Choice
1. What Does The Term Hardware Refer To?
a. The Relative Difficulty Of Writing Computer Programs
b. The Physical Components That Make Up A Computer
c. The Way A Computer's Storage Space Is Organized
d. The Logical Flow Of Instructions
e. None Of
These Answer: B
2. A(N) Is A Set Of Instructions That The Computer Follows To Solve A Problem.
a. Compiler
b. Linker
c. Program
d. Operator
e. None Of
These Answer: C
3. Computer Programs Are Also Known As
a. Hardware
b. Firmware
c. Software
d. Any Of These
e. None Of
These Answer: C
4. At The Heart Of A Computer Is Its Central Processing Unit. The Cpu's Job Is:
a. To Fetch Instructions
b. To Carry Out The Operations Commanded By The Instructions
c. To Produce Some Outcome Or Resultant Information
d. All Of These
e. None Of
These Answer:
D
5. A Computer Stores A Program While It Is Running
a. In Main Memory
b. On A Hard Disk
c. On The Computer Monitor
d. In The Cpu
e. None Of
These Answer:
A
6. The Decodes An Instruction And Generates An Electronic Signal.
a. Arithmetic And Logic Unit
b. Main Memory
c. Bios
d. Control Unit
e. None Of These
, Answer: D
7. The Cpu's Control Unit Retrieves The Next Instruction In A Sequence Of Program Instructions From
Main Memory In The Stage.
a. Fetch
b. Decode
c. Execute
d. Portability
Answer: A
8. During Which Stage Does The Central Processing Unit Analyze The Instruction And Encode It In
The Form Of A Number, And Then Generate An Electronic Signal?
a. Fetch
b. Decode
c. Execute
d. Portability
Answer: B
9. The Two Parts Of The Cpu Are
a. The Output Device And The Input Device
b. The Software And The Hardware
c. The Control Unit And The Arithmetic And Logic Unit
d. The Single-Task Device And The Multi-Task Device
e. None Of
These Answer: C
10. A Volatile Type Of Memory That Is Used For Temporary Storage Is
a. An Address
b. The Alu
c. Ram
d. A Disk Drive
e. None Of
These Answer: C
11. The Purpose Of A Memory Address Is:
a. To Identify The Location Of A Byte In Memory
b. To Prevent Multitasking
c. To Obtain An Algorithm
d. To Improve The Speed Of Processing
e. None Of
These Answer:
A
12. Programs Are Normally Stored In And Loaded Into Main Memory As Needed.
a. The Input Device
b. The Output Device
c. Secondary Storage
d. The Cpu
, e. None Of
These Answer: C
13. A Computer Monitor Is A Type Of
a. Input Device
b. Output Device
c. Storage Device
d. Software
e. None Of
These Answer:
A
14. Which Of The Following Is Not A Common Input Device?
a. Keyboard
b. Mouse
c. Digital Camera
d. Printer
e. All Are Common Input
Devices Answer: D
15. Which Of The Following Is Not One Of The Major Components Of A Computer System?
a. The Preprocessor
b. The Cpu
c. Main Memory
d. Input/Output Devices
e. Secondary
Storage Answer: A
16. A Set Of Well-Defined Steps For Performing A Task Or Solving A Problem Is Known As A(N):
a. Hierarchy Chart
b. Algorithm
c. Instruction Set
d. Statement
e. None Of
These Answer: B
17. When A Programmer Saves To A File The Statements He Or She Writes To Create A
Program, These Statements Are
a. High Level
b. Source Code
c. A Preprocessor File
d. Object Code
e. None Of
These Answer: B
18. The Programmer Usually Enters Source Code Into A Computer With
a. A Hierarchy Chart
b. A Text Editor
, c. A Compiler
d. Pseudocode
e. None Of
These Answer: B
19. In The Process Of Translating A Source File Into An Executable File, Which Of The Following Is
The Correct Sequence?
a. Source Code, Preprocessor, Modified Source Code, Linker, Object Code, Compiler,
Executable Code
b. Preprocessor, Source Code, Compiler, Executable Code, Linker, Modified Source Code,
Object Code
c. Source Code, Compiler, Modified Source Code, Preprocessor, Object Code, Linker,
Executable Code.
d. Source Code, Preprocessor, Modified Source Code, Compiler, Object Code, Linker,
Executable Code.
e. Source Code, Linker, Object Code, Compiler, Modified Source Code, Preprocessor,
Executable Code.
Answer: D
20. An Integrated Development Environment (Ide) Typically Consists Of
a. A Text Editor
b. A Compiler
c. A Debugger
d. All Of The Above
e. None Of
These Answer:
D
21. Are Used To Translate Each Source Code Instruction Into The Appropriate Machine
Language Instruction.
a. Modules
b. Runtime Libraries
c. Compilers
d. Preprocessor Directives
e. None Of
These Answer: C
22. This Is A Set Of Rules That Must Be Followed When Constructing A Program:
a. Syntax
b. Punctuation
c. Key Words
d. Operators
e. Identifiers
Answer: A
23. Words That Have A Special Meaning And May Be Used Only For Their Intended Purpose Are Known
As
a. Operators
b. Programmer Defined Words
c. Key Words
, d. Syntax
e. None Of
These Answer: C
24. Which Of The Following Best Describes An Operator?
a. An Operator Is A Rule That Must Be Followed When Constructing A Program.
b. An Operator Allows You To Perform Operations On One Or More Pieces Of Data.
c. An Operator Marks The Beginning Or Ending Of A Statement, Or Is Used To Separate
Items In A List.
d. An Operator Is A Word That Has A Special Meaning.
e. An Operator Is A Symbolic Name That Refers To A
Variable. Answer: B
25. This Is Used In A Program To Mark The Beginning Or Ending Of A Statement, Or Separate Items In A
List:
a. Separators
b. Punctuation
c. Operators
d. Key Words
e. None Of
These Answer: B
26. Characters Or Symbols That Perform Operations On One Or More Operands Are:
a. Separators
b. Op Codes
c. Operators
d. Key Words
e. None Of
These Answer: C
27. This Is A Complete Instruction That Causes The Computer To Perform Some Action:
a. Line
b. Statement
c. Variable
d. Key Word
e. None Of
These Answer: B
28. A Named Storage Location In The Computer's Memory That Holds A Piece Of Information Is A(N):
a. Variable
b. Operator
c. Key Word
d. Statement
e. None Of
These Answer:
A
29. A Variable Definition Defines The Name Of A Variable That Will Be Used In A Program, As Well As:
a. The Type Of Data It Will Be Used To Hold
, b. The Operators That Will Be Used On It
c. The Number Of Times It Will Be Used In The Program
d. The Value It Will Hold
e. None Of
These Answer:
A
30. Three Primary Activities Of A Program Are:
a. Variable Definitions, Operators, Lists Of Key Words
b. Lines, Statements, Punctuation
c. Input, Processing, Output
d. Integer, Floating-Point, Character Definitions
e. None Of
These Answer: C
31. Which Step Uncovers Any Syntax Errors In Your Program?
a. Editing
b. Compiling
c. Linking
d. Executing
e. None Of
These Answer: B
32. Mistakes That Cause A Running Program To Produce Incorrect Results Are Called:
a. Syntax Errors
b. Logic Errors
c. Compiler Errors
d. Linker Errors
e. None Of
These Answer: B
33. The Programming Process Consists Of Several Steps, Which Include:
a. Key Words, Operator Definitions, Punctuation
b. Design, Creation, Testing, Debugging
c. Input, Processing, Output
d. Syntax, Logic, Error Handling
e. None Of
These Answer: B
34. The First Step In Writing A Program Is To
a. Type The Code
b. Visualize The Program Running On A Computer
c. Visualize Logical Errors
d. Clearly Define What The Program Is To Do
e. None Of
These Answer:
D
,35. A Model Often Used When Creating A Program That Begins With The Overall Task And
Refines It Into Smaller Subtasks Is A(N)
a. Flowchart
b. Uml Diagram
c. Blueprint
d. Hierarchy Chart
e. None Of
These Answer:
D
36. The Term That Refers To The Programmer Reading The Program From The Beginning And
Stepping Through Each Statement Is
a. Pseudocoding
b. Software Engineering
c. Desk Checking
d. Spot Checking
e. None Of
These Answer: C
37. The Two Methods Used By C++ To Write Computer Programs Are:
a. Top-Down Programming And Procedural Programming
b. Procedural Programming And Object-Oriented Programming
c. Pseudocoding And Object-Oriented Programming
d. Flowcharting And Procedural Programming
e. None Of
These Answer: B
, Starting Out With C++ From Control Structures To Objects, 10e (Gaddis)
Chapter 2 Introduction To C++
True/False
1. The Preprocessor Reads A Program Before It Is Compiled And Only Executes Those Lines Beginning
With # Symbol.
Answer: T
2. Because C++ Is Case-Sensitive, All Programs Must Have A Function Called Main Or Main.
Answer: F
3. In Programming, The Terms "Line" And "Statement" Always Mean The Same Thing.
Answer: F
4. In C++, Key Words Are Written In All Lowercase Letters.
Answer: T
5. The Preprocessor Executes After The Compiler.
Answer: F
6. A Value Is Stored In A Variable With An Assignment Statement.
Answer: T
7. Programming Style Refers To The Way A Programmer Uses Elements Such As Identifiers, Spaces,
And Blank Lines.
Answer: T
8. When Typing Your Source Code Into The Computer, You Should Be Careful Since Most Of
Your C++ Instructions, Header Files, And Variable Names Are Case Sensitive.
Answer: T
9. In C++ You Are Required To Name Your Variables So They Indicate The Purpose They Will Be Used
For.
Answer: F
10. Escape Sequences Are Always Stored Internally As A Single Character.
Answer: T