Test Bank Starting Out with Java: Early Objects, 5/E Tony Gaddis PDF Download Full Book with All Chapters
Test Bank Starting Out with Java: Early Objects, 5/E Tony Gaddis PDF Download Full Book with All Chapters
http://testbankbell.com/product/starting-out-with-c-early-objects-9th-
edition-gaddis-test-bank/
http://testbankbell.com/product/solution-manual-for-starting-out-with-
c-early-objects-6th-edition-tony-gaddis-judy-walters-godfrey-muganda/
http://testbankbell.com/product/starting-out-with-java-from-control-
structures-through-objects-6th-edition-gaddis-test-bank/
http://testbankbell.com/product/solutions-manual-to-accompany-data-
and-computer-communications-10th-edition-by-stallings-0133506487/
Solution Manual for Managerial Economics: Foundations of
Business Analysis and Strategy, 13th Edition, Christopher
Thomas, S. Charles Maurice
http://testbankbell.com/product/solution-manual-for-managerial-
economics-foundations-of-business-analysis-and-strategy-13th-edition-
christopher-thomas-s-charles-maurice/
http://testbankbell.com/product/test-bank-for-essentials-of-economics-
the-mcgraw-hill-series-economics-9th-edition-bradley-schiller/
http://testbankbell.com/product/solution-manual-for-
macroeconomics-6th-canadian-edition-stephen-d-williamson-2/
http://testbankbell.com/product/test-bank-for-employment-and-labor-
law-10th-edition-patrick-j-cihon-james-ottavio-castagnera/
http://testbankbell.com/product/fundamentals-of-nursing-potter-8th-
edition-test-bank/
Solution Manual for Introduction to Statistics and Data
Analysis 6th by Peck
http://testbankbell.com/product/solution-manual-for-introduction-to-
statistics-and-data-analysis-6th-by-peck/
Starting Out with Java Early Objects, 5e (Gaddis)
4) Which of the following is not a rule that must be followed when naming identifiers?
A) After the first character, you may use the letters a-z, A-Z, an underscore, a dollar sign, or digits 0-9.
B) Identifiers can contain spaces.
C) Uppercase and lowercase characters are distinct.
D) The first character must be one of the letters a-z, A-Z, an underscore or a dollar sign.
Answer: B
5) Character literals are enclosed in ________, and string literals are enclosed in ________.
A) single quotes, double quotes
B) double quotes, single quotes
C) single quotes, single quotes
D) double quotes, double quotes
Answer: A
1
Copyright © 2015 Pearson Education, Inc.
6) What is the result of the following expression?
17 % 3 * 2 - 12 + 15
A) 105
B) 12
C) 7
D) 8
Answer: C
7) What will be the value of z after the following statements have been executed?
int x = 4, y = 33;
double z;
z = (double) (y / x);
A) 8.25
B) 4
C) 0
D) 8.0
Answer: D
10 + 5 * 3 — 20
A) -5
B) -50
C) 5
D) 25
Answer: C
10) Which of the following statements will correctly convert the data type, if x is a float and y is a
double?
A) x = float y;
B) x = <float>y;
C) x = (float)y;
D) x = y;
Answer: C
2
Copyright © 2015 Pearson Education, Inc.
11) The boolean data type may contain the following range of values:
A) -128 to +127.
B) true or false.
C) -2,147,483,648 to +2,147,483,647.
D) -32,768 to +32,767.
Answer: B
12) What output will be displayed as a result of executing the following code?
int x = 5, y = 20;
x += 32;
y /= 4;
System.out.println("x = " + x + ", y = " + y);
A) x = 160, y = 80
B) x = 32, y = 4
C) x = 37, y = 5
D) x = 9, y = 52
Answer: C
15) To print "Hello, world" on the monitor, use the following Java statement:
A) System.out.println("Hello, world");
B) System Print = "Hello, world";
C) SystemOutPrintln('Hello, world');
D) system.out.println{Hello, world};
Answer: A
3
Copyright © 2015 Pearson Education, Inc.
17) What would be displayed as a result of the following code?
18) In the following Java statement what value is stored in the variable name?
A) "name"
B) the memory address where "John Doe" is located
C) the memory address where name is located
D) "John Doe"
Answer: B
19) What will be the displayed when the following code is executed?
A) x = 22, y = 26
B) x = 22, y = 4
C) x = 22, y = 88
D) Nothing. There is an error in the code.
Answer: D
4
Copyright © 2015 Pearson Education, Inc.
21) What will be displayed after the following statements have been executed?
A) x = 27, y = 3.333, z = 18
B) x = 27, y = 2, z = 18
C) x = 37, y = -14, z = 4
D) x = 27, y = 3, z = 18
Answer: D
22) Which of the following statements correctly creates a Scanner object for keyboard input?
A) Scanner kbd = new Scanner(System.keyboard);
B) Scanner keyboard = new Scanner(System.in);
C) Scanner keyboard(System.in);
D) Keyboard scanner = new Keyboard(System.in);
Answer: B
23) What will be the value of z as a result of executing the following code?
int x = 5, y = 28;
float z;
z = (float) (y / x);
A) 5.6
B) 3.0
C) 5.0
D) 5.60
Answer: C
24) The primitive data types only allow a(n) ________ to hold a single value.
A) class
B) literal
C) object
D) variable
Answer: D
5
Copyright © 2015 Pearson Education, Inc.
26) This statement tells the compiler where to find the JOptionPane class and makes it available to your
program.
A) import javax.swing.JOptionPane;
B) import Java.Swing.JOptionPane;
C) import JOptionPane;
D) import javax.JOptionPane;
Answer: A
28) A(n) ________ is a dialog box that prompts the user for input.
A) input box
B) user prompt
C) adaptive dialog
D) input dialog
Answer: D
29) The simplest way you can use the System.out.printf method is
A) with a format string, and one format specifier.
B) with only a format string, and no additional arguments.
C) with a format string, and one or more format specifiers.
D) with only one format specifier, and no format string.
Answer: B
30) If you wish to use the System.out.printf method to print a string argument, use the ________
format specifier.
A) %d
B) %b
C) %f
D) %s
Answer: D
6
Copyright © 2015 Pearson Education, Inc.
2.2 True/False Questions
1) Programming style includes techniques for consistently putting spaces and indentation in a program
so visual cues are created.
Answer: TRUE
2) Both character literals and string literals can be assigned to a char variable.
Answer: FALSE
3) A variable's scope is the part of the program that has access to the variable.
Answer: TRUE
4) Named constants are initialized with a value, and that value cannot change during the execution of the
program.
Answer: TRUE
5) When you call one of the Scanner class's methods to read a primitive value, such as nextInt or
nextDouble, and then call the nextLine method to read a string, an annoying and hard-to-find
problem can occur.
Answer: TRUE
6) A message dialog is a quick and simple way to ask the user to enter data.
Answer: FALSE
7) The Java API provides a class named Math, which contains numerous methods that are useful for
performing complex mathematical operations.
Answer: TRUE
8) Unlike a console program, a program that uses JOptionPane does not automatically stop executing
when the end of the main method is reached.
Answer: TRUE
10) If you use a flag in a format specifier, you must write the flag before the field width and the precision.
Answer: TRUE
7
Copyright © 2015 Pearson Education, Inc.
Other documents randomly have
different content
The Project Gutenberg eBook of The Summers
readers: primer
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Language: English
BY
MAUD SUMMERS
Copyright, 1908, by
Frank D. Beattys and Company
New York
I can sing.
I can hop.
I can run and sing.
I can hop and jump.
I have a dog.
I have a kitty.
I have a bird.
Run to me.
Sing to me.
Can you hop to me?
A boy runs.
The boys run.
A bird sings.
The birds sing.
I like Rover.
Rover likes me.
This is Kitty’s
ball.
It is a little blue
ball.
ACTION SENTENCES
I see a boy.
He is named John.
He has brown eyes.
He has a sister Mary.
Can you see John?
This is Mary’s doll.
She has brown eyes.
She has a blue dress.
Have you a doll?
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
testbankbell.com