CSA Unit4 Lucky Test

CSA Unit4 Lucky Test

10th Grade

15 Qs

quiz-placeholder

Similar activities

CSP-Selection and Iteration

CSP-Selection and Iteration

9th - 12th Grade

10 Qs

Programming Variables

Programming Variables

10th Grade

10 Qs

AP CS A Unit 3

AP CS A Unit 3

9th - 12th Grade

20 Qs

Computer Science Principles

Computer Science Principles

9th - 12th Grade

20 Qs

Representing and understanding algorithms

Representing and understanding algorithms

10th - 11th Grade

10 Qs

AP CSP Unit 6

AP CSP Unit 6

10th - 12th Grade

20 Qs

AP CSA Unit 1 Review

AP CSA Unit 1 Review

10th - 12th Grade

20 Qs

Unit 5 Quiz - Loops & Lists (code.org)

Unit 5 Quiz - Loops & Lists (code.org)

10th - 12th Grade

20 Qs

CSA Unit4 Lucky Test

CSA Unit4 Lucky Test

Assessment

Quiz

Computers

10th Grade

Medium

Created by

Shanshan 黄珊珊 Huang

Used 9+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following best describes the error in the program?

The variable prod is incorrectly initialized.

The while condition always evaluates to false.

The while condition always evaluates to true.

The negative number entered to signal no more input is included in the product.

If the user enters a zero, the computation of the product will be terminated prematurely.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

1

3

5

7

8

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is printed as a result of executing this code segment?

1

2

3

5

6

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following best explains how the output changes from code segment I to code segment II?

Both code segments produce the same output, because they both iterate four times.

Both code segments produce the same output, because they both iterate five times.

Code segment I prints more values than code segment II does, because it iterates for one additional value of k.

Code segment II prints more values than code segment I, because it iterates for one additional value of k.

The code segments print the same values but in a different order, because code segment I iterates from 1 to 5 and code segment II iterates from 5 to 1.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following best describes the value returned from a call to doWhat ?

num

The sum of all integers between 1 and num, inclusive

The sum of all even integers between 1 and num, inclusive

The sum of all odd integers between 1 and num, inclusive

No value is returned because of an infinite loop.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following method. What value is returned as a result of the call getTheResult(8) ?

48

105

384

5040

40320

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The number of times the string check occurs in str

The index of the first occurrence of check inside str

The index of the last occurrence of check inside str

The number of substrings in str with the same length as check

The number of substrings in str that do not match check

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?