# AP CSP Practice Test Questions Answers [PDF]

AP CSP Practice Test Questions Answers [PDF]: College Board’s Advanced Placement® Program (AP®) Computer Science Principles (CSP) exam practice test. There are a total of 35 multiple choice question answers. In addition, you can download this practice test in a PDF file.

What is AP Computer Science Principles and what will you learn in the class? The AP Computer Science Principles course is designed to give students a broad overview of computing. In the course, students learn how to use computer science to create algorithms and programs that solve problems.

## AP CSP Practice Test Questions Answers [PDF]

 Test Name AP Computer Science Principles Test Type CBT Total Questions 35 Type of question sample questions answers Time limit N/A Answers Key Available Printable PDF upload soon Test Authority The College Board

Q1. Order the numbers from lowest to highest.

I. 12HEX
II. 12DEC
III. 12OCT

• A. I, II, and III
• B. III, II, and I
• C. II, III, and I
• D. I, III, and II

Q2. Order the numbers from lowest to highest.

I. AHEX
II. 11 DEC
III. 1111BIN

• A. I, II, III
• B. III, II, I
• C. II, III, I
• D. I, III, II

Q3. Order the numbers from highest to lowest.

I. AAHEX
II. 99 DEC
III. 1111BIN

• A. I, II, III
• B. III, II, I
• C. II, III, I
• D. I, III, II

Q4. Order the numbers from highest to lowest.
I. AAHEX
II. 99DEC
III. 77OCT

• A. I, II, III
• B. III, II, I
• C. II, III, I
• D. I, III, II

Q5. Convert 48DEC to a binary number.

• A. 110001BIN
• B. 110000BIN
• C. 110111BIN
• D. 111111BIN

Q6. Convert 63DEC to a binary number.

• A. 110001BIN
• B. 110000BIN
• C. 110111BIN
• D. 111111BIN

Q7. Convert 17OCT to a binary number.

• A. 10001BIN
• B. 1111BIN
• C. 10111BIN
• D. 11111BIN

Q8. Convert ACHEX to a binary number.

• A. 10101100BIN
• B. 11001010BIN
• C. 11110000BIN
• D. 11111111BIN

Q9. Convert 2A HEX to a binary number.

• A. 00101010 BIN
• B. 11001010 BIN
• C. 11110000 BIN
• D. 11111111 BIN

Q10. Convert 16HEX to a binary number.

• A. 10101BIN
• B. 10110BIN
• C. 11110BIN
• D. 11111BIN

Q11. Which of the following is NOT possible using the RANDOM(a, b) and
DISPLAY(expression) abstractions?
DISPLAY(RANDOM(2, 5))

• A. 2
• B. 4
• C. 5
• D. 6

Q12. Which of the following is NOT possible using the RANDOM(a, b) and
DISPLAY(expression) abstractions?
DISPLAY(RANDOM(1, 4) + RANDOM(2, 5)

• A. 6
• B. 9
• C. 1
• D. 5

Q13. Which of the following will result in an overflow error in a three-bit system?

• A. 3
• B. 4
• C. 6
• D. 8

Q14. Which of the following will result in an overflow error in a four-bit system?

• A. 6
• B. 9
• C. 15
• D. 16

Q15. Which is the largest number that will NOT result in an overflow error in a five-bit system?

• A. 30
• B. 34
• C. 32
• D. 33
[/su_accordion

Q16. Which math solution could result in a roundoff error?

• A. 1/3
• B. 2 * 6
• C. 6 – 2
• D. 3 + 5

Q17. Many older computers were only designed to handle 8-bit systems, meaning that all numbers that the computers used could not exceed 8 bits in length. Which of the following hexadecimal numbers would NOT be viable in an 8-bit system?

• A. 14HEX
• B. 34HEX
• C. 84HEX
• D. 100HEX

Q18. Many computing languages store an integer in 4 bytes, limiting the range of numbers to from 2,147,483,648 to -2,147,483,647. Given that numbers can be of infinite size, why is this limitation put in place? Select two answers.

• A. Programmers need numbers to be as small as possible because that limits rollover errors.
• B. Most computed numbers are within this range, so 4 bytes is a reasonable size for most purposes.
• C. Making an integer infinite would require so much space that it would be impractical for most uses.
• D. No programmer ever needs a number outside of this range, sothere’s no point in extending the limit.

Q19. A programmer working for an architect needs to create a program to describe several properties with given names, areas, and images. Assume that the properties behave in an identical manner. What would be a benefit of creating an abstraction that uses these three as parameters?

• A. The parameters would allow all the objects to hold their own properties without requiring each to be coded separately.
• B. The abstraction would be able to account for every difference in the way the objects behave.
• C. The abstraction would make them harder to include in the code, which makes stealing and editing the program code more difficult.
• D. The use of an abstraction would ensure that each object’s files can be edited.

Q20. Find the error in the following low-level programming code.

10111001 11010010 0000011 100001001 00001110 00000000
00000000 10111001 11100001 00010000 10001001 00001110
00000010 00000000 10100001 00000000 00000000 1001011
00011110 00000010 00000000 00000011 11000011 10100011
00000100 00000000 100001001 00001110 00000000 00000000
10111001 11100001 00010000 10001001 00001110 00000010
00000000 10100001 00000000 00000000 1001011 00011110
00000010 00000000 00000011 11000011 10100011

• A. The 17th 1 needs to be changed to a 0.
• B. This is too difficult. To determine errors, it would be considerably easier to use an upper-level language.
• C. The 34th 0 should be a 1.
• D. The 84th digit should be a 1.

Q21. Order the following programming languages from low-level language to high-level language. COBOL Python Machine code

• A. COBOL, Python, and machine code
• B. Python, machine code, and COBOL
• C. Machine code, COBOL, and Python
• D. All languages have equal level language.

Q22. Order the following hardware from low-level abstraction to high-level abstraction.

Video card
Transistor
Computer

• A. Video card, transistor, and computer
• B. Transistor, computer, and video card
• C. Transistor, video card, and computer
• D. Hardware does not have abstraction levels.

Q23. Why is it usually easier to read code written in a high-level language than compared to a lower-level language?

• A. High-level languages tend to be written by smarter people.
• B. High-level languages tend to be closer to basic computer code, which makes it easier to translate them.
• C. High-level languages tend to be written for more experienced programmers to use, which implicitly makes them easier to read.
• D. High-level languages tend to be closer to natural language by utilizing simplified abstractions with descriptive names.

Q24. The abstraction Draw(magnitude, direction) is used to draw line segments at a given magnitude and direction (north, south, east, or west) starting at the tip of the first vector to the tail of the second vector. Consider the following program, where the vector starts in the upper-left corner of a grid of dots.

Draw(2, south)
Draw(1, east)
Draw(2, east)
Draw(1, north)

which of the following represents the figure that is drawn by the program? Q25. Taken as a whole, is a physical computer low-level or high-level?

• A. Low-level, because the computer processes the lowest-level form of software
• B. High-level, because the computer contains many lower-level components, such as the CPU
• C. High-level, because the computer is capable of utilizing higherlevel programming languages
• D. Neither, as it is not software

Q26. Logic gates are physical hardware that are used to determine Boolean functions such as AND and OR. Given this, are Boolean functions abstractions?

• A. Yes, they represent the activity of these gates in a manner that can be coded.
• B. Yes, they represent the physical presence of the gates.
• C. No, they are performed by processors; logic gates are merely a way to visualize this.
• D. No, they are not abstractions because they deal with things at the bit level.

Q27. A theme park wants to create a simulation to determine how long it should expect the wait time at its most popular ride. Which of the following characteristics for the virtual patrons would be most useful? Select two answers.

• A. Ride preference—denotes whether a patron prefers roller coasters, other thrill rides, gentle rides, or no rides.
• B. Walking preference—denotes how far a patron is willing to walk in between rides.
• C. Food preference—denotes the type of food that a patron prefers to eat (e.g., chicken, burgers, salads).
• D. Ticket type—denotes whether the patron has a single-day pass, a multi-day pass, or an annual pass.

Q28. A programmer has created a program that models the growth of foxes and rabbits. Which of the following potential aspects of the simulation does NOT need to be implemented?

• A. A representation of grass that rabbits must eat frequently to survive.
• B. Each rabbit may only have a certain amount of children per litter.
• C. Each fox must eat a rabbit frequently to survive.
• D. Each rabbit can only live to a certain age, assuming that they are not eaten.

Q29. When the FAA investigates plane crashes, they often have high-level pilots replay the scenario to see if the situation could have been avoided. This is typically done using a moving simulator, as opposed to an actual airplane. Why?

• A. A simulator is much clumsier to pilot than a real airplane, so the pilots’ being successful is proof that an amateur pilot would be successful as well.
• B. A simulator is much easier to pilot than a real airplane, so the pilots’ failing is proof that any pilot would be unsuccessful.
• C. If the crash could not be properly avoided, it would be much more expensive to replace a simulator than an actual airplane.
• D. If the crash could not be properly avoided, this would put the pilots (and potentially others) in mortal danger.

Q30. The heavy use of chemicals called chlorofluorocarbons (CFCs) has caused damage to the Earth’s ozone layer, creating a noticeable hole over Antarctica. A scientist created a simulation of the hole in the layer using a computer, which models the growth of the hole over many years. Which of the following could be useful information that the simulation could produce?

• A. The approximate length of time until the hole would be refilled (due to various atmospheric processes)
• B. The exact size of the hole at any given point in time
• C. The exact length of time until the hole would be refilled (due to various atmospheric processes)
• D. The exact depth of the hole at any point in time

Q31. Suppose that an environmentalist wanted to understand the spread of invasive species. What would be a benefit of doing this with a simulation, rather than in real life?

• A. The species used in the simulation could be designed to mimic many different species at once.
• B. The species created could be quickly tested in multiple environments to better understand how its spread is affected by environmental factors.
• C. The simulation could be run much more quickly than in real life.
• D. All of the above

Q32. A program is being created to simulate the growth of a brain-based on randomly determined environmental factors. The developer plans to add a feature that lets the user quickly run several hundred simulations with any number of factors kept constant. Why would this be useful? Select two answers.

• A. It would allow the user to gather data without taxing the computer’s hardware.
• B. It would allow the user to see the effect of specific variables by ensuring that the others do not change.
• C. It would quickly provide the user with a large amount of data.
• D. It would make simulations more detailed.

Q33. Which of the following computer languages have the highest level of abstractions?

• A. COBOL
• B. Machine code
• C. Python/JAVA
• D. All of the above

Q34. Which of the following has the lowest level of hardware abstraction?

• A. Transistors
• B. Computer chips
• C. Motherboard
• D. Computer