Search Header Logo

AP CSP Practice Test 1 (1)

Authored by Quốc Thư

Computers

7th - 9th Grade

Used 4+ times

AP CSP Practice Test 1 (1)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Media Image

Consider the following code.

What is displayed because of executing the code segment?

1 3 5 7 9

1 5 7

3 9

9

Answer explanation

Media Image

2.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Media Image

Consider the following code segment.

What is displayed as a result of executing the code segment?

Dog Cat Fish Golden Bandicoot

Dog Cat Fish

Dog Golden Bandicoot Cat Fish

Golden Bandicoot Cat Fish

Answer explanation

petList is initialized containing the value Dog

petList[Dog]

- The value Cat is added to the end of petList

- petList[Dog Cat]

- The value Fish is added to the end of petList

- petList[Dog Cat Fish]

The value Golden Bandicoot is added at position 2 of petList and shifts all values after position 2 to the right.

- petList [Dog Golden Bandicoot Cat Fish]

- The value in position 1 of petList is removed, and all values to the right of position 1 are shifted to the left: petList[Golden Bandicoot Cat Fish]

Each item in petList is displayed, resulting in [Golden Bandicoot Cat Fish].

3.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Media Image

Students at a high school receive letter grades based on the following scale:

Scores - Grades letter

I only

III only

I and II only

I, II and III

Answer explanation

Media Image

4.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Colors can be represented by decimal values from 0 to 255. If each pixel in a photo is a combination of three color values, what is the minimum number of bits needed to store a single pixel?

512

256

24

8

Answer explanation

Determine the minimum number of bits to hold the number 254:

254 − 128 = 126

  126 − 64 = 62

    64 − 32 = 30

    30 − 16 = 14

      14 − 8 = 6

        6 − 4 = 2

        2 − 2 = 0

11111110

It takes 8 bits to hold the number 255.

Three colors would require 8 bits × 3 = 24 bits.

5.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Which of the following is a true statement about data transmitted over the internet?

All data traveling over the internet is binary.

Packets are received in the same order that they are sent.

Redundancy in the design of the internet is overseen by large companies that set the standards used.

The domain name system (DNS) has been challenged by the Digital Millennium Copyright Act (DMCA).

Answer explanation

The internet uses fiber-optic cables that transmit data as “on” or “off,” which is represented in binary as 0 or 1.

(B)Due to the fault-tolerant nature of the internet, packets travel in different directions through the internet. Since packets travel in different directions, they arrive at their destination in a different order than that in which they were sent.

(C)There is no central governing body that controls the design of the internet.

(D)The Digital Millennium Copyright Act does not relate to the internet naming convention.

6.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Media Image

What will the following code segment display?

1 4 7 10 9

10

9 10 7 4 1

Nothing will be displayed due to the error index out of bounds.

Answer explanation

The procedure is trying to access index 0. The language used on this AP exam starts on index 1. So 0 is out of bounds and will result in an error.

7.

MULTIPLE CHOICE QUESTION

2 mins • 5 pts

Media Image

What should replace <missing condition> so that the program below displays TRUE 60% of the time?

x < 6

x >= 6

x > 10

x £ 10

Answer explanation

There are ten numbers between 5 and 14 inclusive: 5, 6, 7, 8, 9, 10, 11, 12, 13, 14. For the condition to evaluate to true 60% of the time, six of the ten numbers must be included: 5, 6, 7, 8, 9, 10. Since x £ 10 would include six numbers, it would result in being true 60% of the time

(A)x < 6 would include only one number and would result in being true 10% of the time.

(B)x ≥ 6 would include nine numbers and would result in being true 90% of the time.

(C)x > 10 would include four numbers and would result in being true 40% of the time.

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?