ST
SOLUTIONS &
UV
IA
PRACTICE
_A
GUIDE
PP
RO
Walter Savitch
VE
D?
Comprehensive Solutions and Practice Resource
for Instructors and Students
??
©STUDYSTREAM
, © Walter Savitch
All rights reserved. Reproduction or distribution without permission is prohibited.
ST
UV
IA
_A
PP
RO
VE
D?
??
©STUDYSTREAM
, Chapter 1 Getting Started 1
ST
Chapter 1
UV
Getting Started
◼ Multiple Choice
IA
1) Java is an object-oriented programming language. An object-oriented language
(a) Uses structured programming.
_A
(b) Views a program as consisting of objects which communicate through interactions.
(c) Functionally breaks down problems into smaller, more manageable problems.
(d) All of the above.
Answer: B
PP
2) In Java, the equal sign is used as the ___________ operator.
(a) increment
(b) decrement
(c) assignment
(d) negation
RO
Answer: C
3) In Java, source code is compiled into object code called ______________.
(a) Bit-code
(b) Class code
VE
(c) Method code
(d) Byte-code
Answer: D
4) The hardest kind of error to detect in a computer program is a:
D?
(a) Syntax error
(b) Run-time error
(c) Logic error
(d) All of the above
??
Answer: C
Copyright © 2016 Pearson Education, Inc., Hoboken NJ
, Chapter 1 Getting Started 2
5) Identify the invalid Java identifier.
(a) 1Week
ST
(b) Week1
(c) amountDue
(d) amount_due
Answer: A
UV
6) What is the value of the variable amountDue?
double price = 2.50;
double quantity = 5;
IA
double amountDue = 0;
amountDue = price * quantity;
_A
(a) 12
(b) 12.25
(c) 12.5
(d) 13
PP
Answer: C
7) What is the value of 7.52e-5?
(a) 752000.0
(b) 0.0000752
RO
(c) 0.000752
(d) 0.00752
Answer: B
8) What is the Java expression for 4a 2 + 2b * c?
(a) (4 * a) + (2 * b) * c
VE
(b) (4 * a * a) + ((2 * b) * c)
(c) ((4 * a * a) + (2 * b)) * c
(d) (4 + a * a) + ((2 + b) * c)
Answer: B
D?
9) What is the Java expression for 27xy?
(a) 27 + (x * y)
(b) 27 * (x + y)
(c) 27 * x * y
??
(d) 27x * y
Answer: C
Copyright © 2016 Pearson Education, Inc., Hoboken NJ