Deck 6: Single-Dimensional Arrays
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/8
Play
Full screen (f)
Deck 6: Single-Dimensional Arrays
1
Write a loop that computes (No need to write a complete program) 
A) 45
B) 11
C) 13
D) 12
E) 10

A) 45
B) 11
C) 13
D) 12
E) 10
C
2
What is the output of the following fragment? 
A) 4
B) 8
C) 16
D) 32
E) 64

A) 4
B) 8
C) 16
D) 32
E) 64
C
3
What is i after the following for loop is finished? 
A) 10
B) undefined
C) 9
D) 11

A) 10
B) undefined
C) 9
D) 11
B
4
Which of the following expression yields an integer between 0 and 100, inclusive? A. (int)(Math.random() * 100 + 1)
B) (int)(Math.random() * 101)
C) (int)(Math.random() * 100)
D) (int)(Math.random() * 100) + 1
B) (int)(Math.random() * 101)
C) (int)(Math.random() * 100)
D) (int)(Math.random() * 100) + 1
Unlock Deck
Unlock for access to all 8 flashcards in this deck.
Unlock Deck
k this deck
5
How many times will the following code print "Welcome to Java"? 
A) 8
B) 0
C) 11
D) 10
E) 9

A) 8
B) 0
C) 11
D) 10
E) 9
Unlock Deck
Unlock for access to all 8 flashcards in this deck.
Unlock Deck
k this deck
6
Analyze the following code:



Unlock Deck
Unlock for access to all 8 flashcards in this deck.
Unlock Deck
k this deck
7
Analyze the following code.
A. count < 100 is always false at Point A B. count < 100 is always true at Point B
C) count < 100 is always false at Point C
D) count < 100 is always true at Point C
E) count < 100 is always false at Point B

C) count < 100 is always false at Point C
D) count < 100 is always true at Point C
E) count < 100 is always false at Point B
Unlock Deck
Unlock for access to all 8 flashcards in this deck.
Unlock Deck
k this deck
8
Write a complete program that prints numbers from 1 to 50, but if numbers that are multiples of 5, print HiFive, else if numbers that are divisible by 2, print HiTwo, and else if numbers that are divisible by 3 or 7, print HiThreeOrSeven.
Unlock Deck
Unlock for access to all 8 flashcards in this deck.
Unlock Deck
k this deck