Search Header Logo

Iteration Quiz review part 2

Authored by David Guy

Computers

9th - 12th Grade

Used 25+ times

Iteration Quiz review part 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Consider the following method.


Which of the following method calls will cause "0 10 " to be printed?

printSome(0,20)

printSome(5,10)

printSome(10,5)

printSome(20,5)

printSome(25,5)

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

"appl"

"apple"

"elppa"

"lppa"

Nothing is returned due to a run-time error.

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Consider the following method.

What, if anything, is returned by the method call abMethod("sing the song", "ng")?

"si"

"si the so"

"si the song"

"sig the sog"

Nothing is returned because a  StringIndexOutOfBoundsExceptionStringIndexOutOfBoundsException   is thrown.

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Consider the following code segment. Assume that  num3\ >\ num2\ >\ 0.  



Which of the following best describes the contents of  num1num1  as a result of executing the code segment?

The product of num2 and num3

The product of num2 and num3-1

The sum of num2 and num3

The sum of all integers from num2 to num3, inclusive

The sum of all integers from num2 to num3-1, inclusive

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Consider the following code segment.


Which of the following code segments will produce the same output as the code segment above?

Media Image
Media Image
Media Image
Media Image
Media Image

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Consider the following code segment. What is printed as a result of executing the code segment?

6

10

12

15

Nothing is printed due to an infinite loop.

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

I only

II only

I and II only

I and III only

I, II and III

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?