Practice Test 5 - AP Computer Science Principles
19 questions. Answer them in any order, then submit to see your score and every explanation.
- The original design motivation for the network that became the Internet included the need for a communication system that could withstand a large-scale disaster. This motivation directly led to which core principle?
- A student is asked to provide the 5-bit binary representation for the decimal number 26. Which of the following is the correct representation?
- A weather app prototype generates a random daily temperature between 50–85°F and random rain chance for practice testing. Randomness is necessary because real weather changes and cannot be perfectly known ahead of time. Some simulated weeks show several rainy days, while others show none at all. The student uses these varied results to test how the display handles different forecasts. Based on the scenario above, what could be a potential outcome if random values were not used in this simulation?
- Which of the following best describes the effect of this action?
- Given this shopping-cart pseudo-code, what will the discount be if isMember=true, total=100, isSeasonSale=false? // Inputs: isMember, total, isSeasonSale IF isMember IF total >= 100 IF isSeasonSale discount = 0.20 ELSE discount = 0.10 ELSE discount = 0.05 ELSE IF isSeasonSale AND total >= 150 discount = 0.15 ELSE discount = 0.00
- Which sequence of conditions must be met for a 5% discount? // Online Shopping Cart discount rules IF isMember IF total >= 100 IF isSeasonalSale discount = 20 ELSE discount = 15 ELSE discount = 5 ELSE IF total >= 150 IF isSeasonalSale discount = 10 ELSE discount = 0 ELSE discount = 0
- A student team builds a simple weather-alert app for their school community. Harper designs screens and writes microcopy; Ishan codes notifications; Celeste tests on different devices; Rowan manages the shared repository and reviews changes. They rely on a group chat for quick coordination, weekly video meetings for planning, and the repository's comment threads for reviewing specific changes. When a bug causes duplicate alerts, Celeste posts, "I get two alerts after toggling 'Severe Weather' off and on." Ishan replies, "I'll patch the toggle logic," and Rowan says, "Please open a review so we can discuss the fix line by line." They resolve tension by using respectful, evidence-based comments and by assigning a clear owner for the fix. The beta release reduces missed alerts and earns praise from teachers. In the described project, which communication method was most effective for reviewing the duplicate-alert fix precisely?
- Which of the following best explains why lists are considered a form of data abstraction?
- When a packet of data travels across the Internet, it is passed from one computing device to another until it reaches its destination. What is the process of determining the path a packet takes from sender to receiver called?
- A student models a savings account using a Monte Carlo simulation with random yearly returns from -5% to +12%. Randomness represents how markets change in ways the program cannot predict exactly. One run may end with slow growth, while another ends with a much larger balance. The student repeats many runs to see a range of possible futures. Based on the scenario above, what is the role of randomness in this application?
- A programmer is developing a mobile game and uses a copyrighted image found on the internet as a background without permission. This action is a direct violation of which legal and ethical principle?
- Read the passage. During backup storage, organizations compress data to reduce the amount of disk space required and to speed up copying large archives. Compression works by encoding information more efficiently, often by finding repeated patterns across files. In this context, lossless compression is preferred because backups must restore data exactly, including program files, spreadsheets, and databases. Huffman coding supports lossless compression by assigning shorter codes to common symbols, while LZW builds a dictionary of repeated sequences so the same patterns can be stored once and referenced many times. Lossy compression, used in formats like JPEG for images and MPEG for video, can shrink files further by discarding subtle details, but that risk is unacceptable for most backups. As a result, backup systems typically prioritize data integrity over maximum size reduction. Why is lossless compression preferred in backup storage?
- A key difference between a citizen science project, such as bird-sighting data collection, and an open-source software project is that the primary contribution in citizen science is typically...
- What is displayed as a result of executing the code?
- Consider the problem of determining if any given computer program, when run on any given input, will eventually print the word "SUCCESS". It has been proven that no single algorithm can be designed to solve this problem for all possible program-input pairs. What type of problem is this?
- A team is designing a mobile game intended for children under the age of ten. Which of the following collaborative activities is most essential for producing a successful and appropriate product?
- ### Crowdsourcing and Society (Scenario: Citizen Science Projects) #### Definition and Role in Computing Crowdsourcing involves recruiting a large group to contribute to a shared task and combining their work into a final output. In computing, the model is effective when platforms can distribute tasks efficiently, record results reliably, and aggregate contributions using statistical methods. #### Zooniverse as a Real-World Example The passage centers on Zooniverse, a citizen science platform where volunteers help analyze massive scientific datasets. Tasks are often designed as quick classifications—such as labeling images—so that many participants can contribute small units of work. Software systems then aggregate multiple judgments per item to increase confidence. #### Benefits: Scale and Cost A key benefit is scalability: instead of a small research team processing millions of images, thousands of volunteers can work in parallel. This can be cost-effective, allowing researchers to allocate funds toward experimental design, computing infrastructure, and validation rather than solely manual labeling. #### Drawbacks: Quality Control The passage notes that volunteer accuracy varies. To mitigate this, projects use redundancy, training, and consensus scoring. Without these safeguards, noisy data can distort scientific conclusions. #### Ethical Concerns Ethical concerns include transparency about how volunteer labor is used, appropriate credit, and protecting participant account data. Responsible projects publish methods and clarify limitations. #### Societal Impact Citizen science expands public engagement with research while illustrating how computing systems can translate distributed human effort into usable scientific datasets. Based on the passage, what is a primary benefit of crowdsourcing in citizen science projects?
- ## Urban vs. Rural Divide: Infrastructure and Reliability ### What the digital divide is The digital divide is the gap between people who have dependable internet and devices and those who lack them. It is significant because connectivity supports learning, work, and access to essential services. ### Data and nuance A 2021 FCC report estimated millions of Americans lacked access to fixed broadband at benchmark speeds, and some analysts argue the number is higher due to mapping limits. The text notes that "access" is not the same as "reliability": a connection that drops often can still disrupt classes and telehealth. ### Examples across demographics - Geography: Rural households may face long repair times after outages. - Income: Monthly costs may be higher where provider choices are limited. - Age: Some older adults rely on family members to troubleshoot devices. ### Bridging efforts Communities use multiple tools: - upgrading local infrastructure - expanding public Wi-Fi - device lending through schools - training sessions for basic troubleshooting ### Takeaway The passage emphasizes that reliability and affordability matter, not just nominal coverage. Based on the text, how does the digital divide affect rural communities differently than urban ones?
- What is the primary benefit of using parameters when defining a procedure in a program?