Deck 6: Single-Dimensional Arrays

Full screen (f)
exit full mode
Question
Write a loop that computes (No need to write a complete program) <strong>Write a loop that computes (No need to write a complete program)  </strong> A) 45 B) 11 C) 13 D) 12 E) 10 <div style=padding-top: 35px>

A) 45
B) 11
C) 13
D) 12
E) 10
Use Space or
up arrow
down arrow
to flip the card.
Question
What is the output of the following fragment? <strong>What is the output of the following fragment?  </strong> A) 4 B) 8 C) 16 D) 32 E) 64 <div style=padding-top: 35px>

A) 4
B) 8
C) 16
D) 32
E) 64
Question
What is i after the following for loop is finished? <strong>What is i after the following for loop is finished?  </strong> A) 10 B) undefined C) 9 D) 11 <div style=padding-top: 35px>

A) 10
B) undefined
C) 9
D) 11
Question
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
Question
How many times will the following code print "Welcome to Java"? <strong>How many times will the following code print Welcome to Java?  </strong> A) 8 B) 0 C) 11 D) 10 E) 9 <div style=padding-top: 35px>

A) 8
B) 0
C) 11
D) 10
E) 9
Question
Analyze the following code: Analyze the following code:    <div style=padding-top: 35px> Analyze the following code:    <div style=padding-top: 35px>
Question
Analyze the following code. 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<div style=padding-top: 35px> 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
Question
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
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/8
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 6: Single-Dimensional Arrays
1
Write a loop that computes (No need to write a complete program) <strong>Write a loop that computes (No need to write a complete program)  </strong> 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? <strong>What is the output of the following fragment?  </strong> 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? <strong>What is i after the following for loop is finished?  </strong> 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
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"? <strong>How many times will the following code print Welcome to Java?  </strong> 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: Analyze the following code:    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. 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 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
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
locked card icon
Unlock Deck
Unlock for access to all 8 flashcards in this deck.