APCSP Practice MCQ
how many bits does it take to represent 200
8 2^7=128 2^8=256 2^9=512
Which of the following best describes the role of the Internet Engineering Task Force (IETF) ? A Developing standards and protocols for Internet communication B Preventing copyrighted materials from being illegally distributed online C Preventing malicious software from being distributed online D Verifying the ownership of encrypted keys used in secured messages
A Developing standards and protocols for Internet communication The IETF develops and oversees standards such as hypertext transfer protocol (HTTP), Internet protocol (IP), and simple mail transfer protocol (SMTP).
Which of the following best explains how data is typically assembled in packets for transmission over the Internet? A Each packet contains data to be transmitted, along with metadata containing information used for routing the data. B Each packet contains an encrypted version of the data to be transmitted, along with metadata containing the key needed to decrypt the data. C Each packet contains only the metadata used to establish a direct connection so that the data can be transmitted. D Each packet contains multiple data files bundled together, along with metadata describing how to categorize each data file.
A Each packet contains data to be transmitted, along with metadata containing information used for routing the data.
Which of the following explains a benefit of using open standards and protocols for Internet communication? A Open standards and protocols allow different manufacturers and developers to build hardware and software that can communicate with hardware and software on the rest of the network. B Open standards and protocols provide ways for users to eliminate the latency of messages they send on the Internet. C Open standards and protocols allow users to freely share or reuse material found on the Internet for noncommercial purposes. D Open standards and protocols prevent developers from releasing software that contains errors.
A Open standards and protocols allow different manufacturers and developers to build hardware and software that can communicate with hardware and software on the rest of the network. Open standards and protocols are used to prescribe the format of data sent over the Internet. This allows all connected hardware and software to communicate in a standard way.
Based on the values in the table, which of the following best characterizes the algorithm for very large values of n ? A The algorithm runs in reasonable time. B The algorithm runs, but not in reasonable time. C The algorithm attempts to solve an undecidable problem. D The algorithm attempts to find an approximate solution whenever it fails to find an exact solution.
A The algorithm runs in reasonable time. The pattern in the table appears to indicate that there are steps for a list containing n items. This number of steps is a polynomial and therefore the algorithm runs in reasonable time.
A user enters a Web address in a browser, and a request for a file is sent to a Web server. Which of the following best describes how the file is sent to the user? A The file is broken into packets for transmission. The packets must be reassembled upon receipt. B The file is broken into packets for transmission. The user's browser must request each packet in order until all packets are received. C The server attempts to connect directly to the user's computer. If the connection is successful, the entire file is sent. If the connection is unsuccessful, an error message is sent to the user. D The server repeatedly attempts to connect directly to the user's computer until a connection is made. Once the connection is made, the entire file is sent.
A The file is broken into packets for transmission. The packets must be reassembled upon receipt. Digital data on the Internet is sent by breaking data into blocks of bits called packets. The packets are reassembled by the user's computer.
Each student that enrolls at a school is assigned a unique ID number, which is stored as a binary number. The ID numbers increase sequentially by 1 with each newly enrolled student. If the ID number assigned to the last student who enrolled was the binary number 1001 0011, what binary number will be assigned to the next student who enrolls? A: 1001 0100 B: 1001 0111 C: 1101 0100 D: 1101 0111
A: 1001 0100
A user wants to save a data file on an online storage site. The user wants to reduce the size of the file, if possible, and wants to be able to completely restore the file to its original version. Which of the following actions best supports the user's needs? A: Compressing the file using a lossless compression algorithm before uploading it B: Compressing the file using a lossy compression algorithm before uploading it C: Compressing the file using both lossy and lossless compression algorithms before uploading it D: Uploading the original file without using any compression algorithm
A: Compressing the file using a lossless compression algorithm before uploading it Lossless compression algorithms allow for complete reconstruction of the original data and typically reduce the size of the data.
Consider the following numeric values. Binary 1011 Binary 1101 Decimal 5 Decimal 12 Which of the following lists the values in order from least to greatest? A: Decimal 5, binary 1011, decimal 12, binary 1101 B: Decimal 5, decimal 12, binary 1011, binary 1101 C: Decimal 5, binary 1011, binary 1101, decimal 12 D: Binary 1011, binary 1101, decimal 5, decimal 12
A: Decimal 5, binary 1011, decimal 12, binary 1101 Binary 1011 is equivalent to 23+21+20, or decimal 11, and binary 1101 is equivalent to 23+22+20, or decimal 13. The order of the numbers (written in their equivalent decimal format) is 5, 11, 12, 13.
A researcher wants to publish the results of a study in an open access journal. Which of the following is a direct benefit of publishing the results in this type of publication? A: The researcher can allow the results to be easily obtained by other researchers and members of the general public. B: The researcher can better anticipate the effect of the results and ensure that they are used responsibly. C: The researcher can ensure that any personal information contained in the journal is kept private and secure. D: The researcher can prevent copies of the research from being accessed by academic rivals.
A: The researcher can allow the results to be easily obtained by other researchers and members of the general public. Information published in an open access journal is free of any and all restrictions on access and free of many restrictions on use, such as copyright or license restriction. This allows other researchers and members of the general public broad access to the results.
Which of the following statements describe how cloud computing has affected Internet communication? Select two answers. A Cloud computing has eliminated the need to provide redundancy in Internet routing. B Cloud computing has helped enhance collaboration. C Cloud computing has introduced new data-security concerns. D Cloud computing has reduced concerns about intellectual property rights.
B Cloud computing has helped enhance collaboration. C Cloud computing has introduced new data-security concerns. Cloud computing fosters new ways to communicate and collaborate, allowing users to share files and tools easily. Cloud computing sites must consider security concerns in order to protect their users' private data.
Which of the following best explains how messages are typically transmitted over the Internet? A The message is broken into packets that are transmitted in a specified order. Each packet must be received in the order it was sent for the message to be correctly reassembled by the recipient's device. B The message is broken into packets. The packets can be received in any order and still be reassembled by the recipient's device. C The message is broken into two packets. One packet contains the data to be transmitted and the other packet contains metadata for routing the data to the recipient's device. D The message is transmitted as a single file and received in whole by the recipient's device.
B The message is broken into packets. The packets can be received in any order and still be reassembled by the recipient's device. Messages are broken into packets. Each packet contains data to be transmitted, as well as metadata for routing and reassembling the data upon receipt. This allows the packets to be received in any order and still be reassembled correctly.
A computer program performs the operation and represents the result as the value . Which of the following best explains this result? A An overflow error occurred. B The precision of the result is limited due to the constraints of using a floating-point representation. C The program attempted to execute the operation with the arguments in reverse order. D The program attempted to represent a floating-point number as an integer.
B The precision of the result is limited due to the constraints of using a floating-point representation. The fixed number of bits used to represent real numbers (as floating-point numbers) limits the range of floating-point values. (Basically floating point is a decimal)
For which of the following strings is it NOT possible to use byte pair encoding to shorten the string's length? A BANANA B LEVEL_UP C MEET_ME_LATER D NEITHER_HERE_NOR_THERE
B LEVEL_UP It is not possible to use byte pair encoding in the string because no pair of characters appears in the string more than once.
Which of the following is an advantage of a lossless compression algorithm over a lossy compression algorithm? A: A lossless compression algorithm can guarantee that compressed information is kept secure, while a lossy compression algorithm cannot. B: A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot. C: A lossless compression algorithm typically allows for faster transmission speeds than does a lossy compression algorithm. D: A lossless compression algorithm typically provides a greater reduction in the number of bits stored or transmitted than does a lossy compression algorithm.
B: A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot. Lossless compression algorithms are guaranteed to be able to reconstruct the original data, while lossy compression algorithms are not.
Which of the following can be represented by a single binary digit? Select two answers. A: The position of the minute hand of a clock B: The remainder when dividing a whole number by 2 C: The value of a Boolean variable D: The volume of a car radio
B: The remainder when dividing a whole number by 2 C: The value of a Boolean variable When dividing a whole number (0, 1, 2, 3, ...) by 2, the remainder will always be 0 or 1. A binary digit, by its definition, stores 0 or 1.
Byte pair encoding is a data encoding technique. The encoding algorithm looks for pairs of characters that appear in the string more than once and replaces each instance of that pair with a corresponding character that does not appear in the string. The algorithm saves a list containing the mapping of character pairs to their corresponding replacement characters. For example, the string "THIS_IS_THE_BEST_WISH" can be encoded as "%#_#_%E_ BEST_W#H" by replacing all instances of TH with % and replacing all instances of IS with #. Which of the following statements about byte pair encoding is true? A Byte pair encoding is an example of a lossy transformation because it discards some of the data in the original string. B Byte pair encoding is an example of a lossy transformation because some pairs of characters are replaced by a single character. C Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version. D Byte pair encoding is an example of a lossless transformation because it can be used to transmit messages securely. %
C Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version. The transformation is lossless because an encoded string can be restored to its original version. For example, can be restored to by replacing all instances of with and by replacing all instances of with .
A population researcher is interested in predicting the number of births that will occur in a particular community. She created a computer model that uses data from the past ten years, including number of residents and the number of babies born. The model predicted that there would be 200 births last year, but the actual number of births last year was only 120. Which of the following strategies is LEAST likely to provide a more accurate prediction? A Gathering data for additional years to try to identify patterns in birth rates B Refining the model used in the computer simulation to more closely reflect the data from the past ten years C Removing as many details from the model as possible so that calculations can be performed quickly D Taking into consideration more information about the community, such as the ages of residents
C Removing as many details from the model as possible so that calculations can be performed quickly Removing details from the model may help it run quickly, but is unlikely to provide more accurate results.
Which of the following best describes the relationship between the World Wide Web and the Internet? A The World Wide Web is a protocol that is accessed using a data stream called the Internet. B The World Wide Web is a system of linked pages, programs, and files that is accessed using a data stream called the Internet. C The World Wide Web is a system of linked pages, programs, and files that is accessed via a network called the Internet. D The World Wide Web is a Web site that is accessed using a protocol called the Internet.
C The World Wide Web is a system of linked pages, programs, and files that is accessed via a network called the Internet. The Internet is an interconnected network of networks, and the World Wide Web is an information system that is accessed via the Internet.
A NAND gate is a type of logic gate that produces an output of FALSE only when both of its two inputs are TRUE. Otherwise, the gate produces an output of TRUE. Which of the following Boolean expressions correctly models a NAND gate with inputs P and Q? A (NOT P) AND (NOT Q) B (NOT P) AND Q C NOT (P AND Q) D NOT (P OR Q)
C NOT (P AND Q) The expression evaluates to when both and are , and evaluates to otherwise. Therefore, the expression evaluates to when both and are , and evaluates to otherwise.
An online store uses 6-bit binary sequences to identify each unique item for sale. The store plans to increase the number of items it sells and is considering using 7-bit binary sequences. Which of the following best describes the result of using 7-bit sequences instead of 6-bit sequences? A: 2 more items can be uniquely identified. B: 10 more items can be uniquely identified. C: 2 times as many items can be uniquely identified. D: 10 times as many items can be uniquely identified.
C: 2 times as many items can be uniquely identified. This option is correct. Using 6-bit binary sequences allows for 26 or 64 different items to be identified. Using 7-bit binary sequences allows for 27 or 128 different items to be identified. Thus there are two times as many items that can be uniquely identified.
A video-streaming Web site uses 32-bit integers to count the number of times each video has been played. In anticipation of some videos being played more times than can be represented with 32 bits, the Web site is planning to change to 64-bit integers for the counter. Which of the following best describes the result of using 64-bit integers instead of 32-bit integers? A: 2 times as many values can be represented. B: 32 times as many values can be represented. C: 232 times as many values can be represented. D: 322 times as many values can be represented.
C: 232 times as many values can be represented.
Consider the 4-bit binary numbers 0011, 0110, and 1111. Which of the following decimal values is NOT equal to one of these binary numbers? A: 3 B: 6 C: 9 D: 15
C: 9
Which of the following actions is most likely to raise legal or ethical concerns? A: An analyst writes a program that scans through a database of open-access scientific journals and creates a document with links to articles written on a particular topic. B: A computer scientist adds several features to an open-source software program that was designed by another individual. C: A musician creates a song using samples of a copyrighted work and then uses a Creative Commons license to publish the song. D: A public interest group alerts people to a scam that involves charging them for a program that is available for free under a Creative Commons license.
C: A musician creates a song using samples of a copyrighted work and then uses a Creative Commons license to publish the song. The use of material created by someone else without permission raises ethical concerns and can have legal consequences. Using a Creative Commons license to publish a derived work does not free the musician from having to first obtain permission.
A certain programming language uses 4-bit binary sequences to represent nonnegative integers. For example, the binary sequence 0101 represents the corresponding decimal value 5. Using this programming language, a programmer attempts to add the decimal values 14 and 15 and assign the sum to the variable total. Which of the following best describes the result of this operation? A: The correct sum of 29 will be assigned to the variable total. B: An overflow error will occur because 4 bits is not large enough to represent either of the values 14 or 15. C: An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15. D: A round-off error will occur because the decimal values 14 and 15 are represented as approximations due to the fixed number of bits used to represent numbers.
C: An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15. The largest binary value that can be represented using 4 bits is 1111, which is equal to the decimal value 15. Since the sum is larger than the largest representable value, an overflow error will occur.
Digital images are often represented by the red, green, and blue values (an RGB triplet) of each individual pixel in the image. A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossless transformation of the digital image? A: Compressing the image in a way that may lose information but will suffer only a small loss of image quality. B: Creating the gray scale of an image by averaging the amounts of red, green, and blue in each pixel and assigning this new value to the corresponding pixel in the new image. The new value of each pixel represents a shade of gray, ranging from white to black. C: Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed. D: Modifying part of the image by taking the pixels in one part of the picture and copying them to the pixels in another part of the picture.
C: Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed. If a negative of the original image is made, each RGB triplet value will be computed by subtracting the original value from 255. The original value can then be restored by subtracting the new value from 255. This process is lossless because the exact original can be restored.
An author is considering publishing an e-book using a Creative Commons license. In which of the following situations would it be better for the author to use a Creative Commons license instead of a traditional copyright? The author wants to make the e-book available as a free download. The author wants to prevent people from sharing copies of the e-book on peer-to-peer networks. The author wants to allow people permission to use and modify the e-book. A: I only B: II only C: I and III D: II and III
C: I and III Statement I is correct because the Creative Commons license is designed to increase the amount of content available to the public for free. Statement III is correct because under Creative Commons the author can stipulate what kind of modification is allowed by users.
A programmer is developing software for a social media platform. The programmer is planning to use compression when users send attachments to other users. Which of the following is a true statement about the use of compression? A Lossless compression of video files will generally save more space than lossy compression of video files. B Lossless compression of an image file will generally result in a file that is equal in size to the original file. C Lossy compression of an image file generally provides a greater reduction in transmission time than lossless compression does. D Sound clips compressed with lossy compression for storage on the platform can be restored to their original quality when they are played.
C: Lossy compression of an image file generally provides a greater reduction in transmission time than lossless compression does. Although fewer bits may be stored, information is not necessarily lost when lossy compression is applied to an image.
Which of the following is considered an unethical use of computer resources? A: Downloading freeware or shareware onto your home computer B: Purchasing a game from an app store and downloading it directly to a mobile device C: Purchasing a single-user copy of photo editing software and installing it on all the computers in a computer lab D: Searching online for an electronic version of a school textbook
C: Purchasing a single-user copy of photo editing software and installing it on all the computers in a computer lab This option is correct. Single-user copies of software are meant for one individual to use. Computer labs are meant for public use, so installing the software on the computers raises ethical concerns.
Grades in a computer science course are based on total points earned on a midterm exam and a final exam. The teacher provides a way for students to improve their course grades if they receive high scores on the final exam: if a student's final exam score is greater than the student's midterm exam score, the final exam score replaces the midterm exam score in the calculation of total points. The table below shows two students' scores on the midterm and final exams and the calculated total points each student earns. Khalil does better on the midterm exam than on the final exam, so his original midterm and final exam scores are added to compute his total points. Josefina does better on the final exam than on the midterm exam, so her final exam score replaces her midterm exam score in the total points calculation. The teacher has data representing the scores of thousands of students. For each student, the data contain the student name, the midterm exam score, the final exam score, and the result of the total points calculation. Which of the following could be determined from the data? I. The average total points earned per studentII. The average increase in total points per student as a result of the score replacement policyIII. The proportion of students who improved their total points as a result of the score replacement policy A III only B I and II only C I and III only D I, II, and III
D I, II, and III The average increase in total points per student as a result of the score replacement policy can also be determined by calculating the differences between each student score before and after the replacement policy was applied. The average total points earned per student can be determined using the result of the total points calculationfor each student. The average increase in total points per student as a result of the score replacement policy can be determined bycalculating the differences between each student score before and after the replacement policy was applied. The proportion of studentswho improved their total points as a result of the score replacement policy can be determined by comparing the midterm and final scores for each student with the result of the total points calculation.
Which of the following is a primary reason for the use of open protocols on the Internet? A Open protocols allow devices to specify how data packets are to be routed on the Internet in advance. B Open protocols ensure that all data transmission on the Internet is kept secure. C Open protocols ensure that all Internet users are provided connections with equal bandwidth. D Open protocols provide a way to standardize data transmission between different devices.
D Open protocols provide a way to standardize data transmission between different devices. Protocols are agreed-upon sets of rules that specify the behavior of a system. Protocols used on the Internet enable devices from different manufacturers to communicate in a standard way.
A video game character can face toward one of four directions: north, south, east, and west. Each direction is stored in memory as a sequence of four bits. A new version of the game is created in which the character can face toward one of eight directions, adding northwest, northeast, southwest, and southeast to the original four possibilities. Which of the following statements is true about how the eight directions must be stored in memory? A: Four bits are not enough to store the eight directions. Five bits are needed for the new version of the game. B: Four bits are not enough to store the eight directions. Eight bits are needed for the new version of the game. C: Four bits are not enough to store the eight directions. Sixteen bits are needed for the new version of the game. D: Four bits are enough to store the eight directions.
D: Four bits are enough to store the eight directions. Four bits can represent 2424, or 16 pieces of information, so it is not necessary to add an extra bit.
The position of a runner in a race is a type of analog data. The runner's position is tracked using sensors. Which of the following best describes how the position of the runner is represented digitally? A: The position of the runner is determined by calculating the time difference between the start and the end of the race and making an estimation based on the runner's average speed. B: The position of the runner is measured and rounded to either 0 or 1 depending on whether the runner is closer to the starting line or closer to the finish line. C: The position of the runner is predicted using a model based on performance data captured from previous races. D: The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.
D: The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample. Analog data, like the runner's position, have values that change smoothly, rather than in discrete intervals. Analog data can be approximated digitally by measuring values of the analog signal at regular intervals called samples. The samples are represented digitally as sequences of bits.
A programmer created a piece of software and wants to publish it using a Creative Commons license. Which of the following is a direct benefit of publishing the software with this type of license? A: The programmer can ensure that the algorithms used in the software are free from bias. B: The programmer can ensure that the source code for the software is backed up for archival purposes. C: The programmer can include code that was written by other people in the software without needing to obtain permission. D: The programmer can specify the ways that other people are legally allowed to use and distribute the software.
D: The programmer can specify the ways that other people are legally allowed to use and distribute the software. A Creative Commons license allows an author to impose restrictions on the use of the licensed product, including restrictions on commercial use.
Which of the following is a true statement about data compression? A: Data compression is only useful for files being transmitted over the Internet. B: Regardless of the compression technique used, once a data file is compressed, it cannot be restored to its original state. C: Sending a compressed version of a file ensures that the contents of the file cannot be intercepted by an unauthorized user. D: There are trade-offs involved in choosing a compression technique for storing and transmitting data.
D: There are trade-offs involved in choosing a compression technique for storing and transmitting data.
ASCII is a character-encoding scheme that uses 7 bits to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table below. (look at ASCII Character chart on doc) https://docs.google.com/document/d/1s2POdzi-P7nbiIidgAqYYT2uuo5joeJK29knj8w8co4/edit What ASCII character is represented by the binary (base 2) number 1001010 ?
J