AP CSP Final Assessment Practice Packet Graded A+
Which of the following elements would be considered a part of the user interface for an app? Choose 1 I. An image that appears on the screen II. A beep that sounds when two sprites collide III. The length and width of the drawing canvas A. I only B. II only C. II and III only D. I, II, and III - ANSWER-D. Which of the following would be a good name for a button whose purpose was to refresh the screen? Choose one A. Button 1 B. ButtonOne C. ButtonRefresh D. RefButton - ANSWER-C. An important programming task is that of refactoring one's code which refers to the process of _____ and _______. Choose two A. Reorganizing duplicated code into procedures B. Revising long code segments into shorter code segments to make the code easier to understand C. Revising the code to remove bugs D. Adding new code to change the way the program behaves - ANSWER-A., B. The main difference between low-level and high-level programming is _____. Choose one A. low-level languages are easier for humans to understand B. high-level languages provide abstractions that closely match the machine's architecture C. high-level languages provide abstractions that are more easily understood by humans D. low-level languages cannot be understood by computers - ANSWER-C. Block A: DrawText "N", 300/2, 150/2 Places the first parameter at the x-location given in the second parameter and the y-location given in the third parameter Block B: DrawText "N", canvasWidth/2 canvasHeight/2 Places the first parameter at the x-location given in the second parameter and the y-location given in the third parameter The DrawText block takes three parameters: letter, x, and y; where x and y are coordinates on the screen. Consider the two blocks A and B which are supposed to draw a N at the center of a canvas that covers the phone's screen. Of these two blocks, ____. Choose one. A. Block A would draw N at the center on any size device B. Block B would draw N at the center on any size device C. Both would draw N at the center of any size device D. Neither would draw N at the center of any size device - ANSWER-B. Both blocks A and B in the previous question are abstractions for solving a certain problem. What can we say about these abstractions? Choose one. A. Block A is a better abstraction because it is more specific. B. Block B is a better abstraction because it is more general. C. Both are equally good abstractions because they are both specific. D. Both are equally good abstractions because they are both general. - ANSWER-B. Express the binary number in decimal notation. Chose one. A. 13 B. 15 C. 26 D. 44 - ANSWER-A. Convert 14 to binary. Choose one. A. 111 B. 1101 C. 0111 D. 1110 - ANSWER-D. A coin is flipped 20 times and the results are 10 heads and 10 tails. What can we say about this outcome. Choose two. A. Because there are more tails than heads, this coin is biased towards tails B. If we flip this coin 10 times, it's likely to come up five heads and five tails C. The results confirm that this coin is an unfair coin D. This is not enough trials to say anything significant about the fairness of the coin - ANSWER-B., D. A model or simulation is an abstraction of a real world phenomenon. Which of the following are models? I. A slot machine that plays a dice game II. A computer program that sends and receives text messages III. A computer program that is used to forecast the weather Choose one A. I only B. II only C. I and III only D. I, II, and III - ANSWER-C. Which of the following is true about algorithms? Choose two A. Algorithms cannot be written in pseudocode B. Algorithms can be written to solve every problem C. Algorithms are step-by-step instructions D. Algorithms consist of sequences, selections, and/or repetitions - ANSWER-C., D. For which of the following problems would the binary search algorithm be useful? Choose one A. Arranging a deck of cards from lowest to highest value cards B. Looking up a word in a dictionary C. Looking up a person's name in the phone book given the person's phone number D. Finding the smallest number in a list of numbers arranged randomly - ANSWER-B. A teacher is trying to determine whether or not a particular student, N, is enrolled in their course. Using a list of the enrolled students' names, which is arranged in no particular order, the most efficient was to find if student N is on the list would be to: choose one A. Perform a binary search B. Perform a linear search C. Sort the list by last name and then perform a binary search D. Sort the list by last name and then perform a lineary search - ANSWER-B. Suppose you are sorting the following list of numbers in ascending order using bubble sort: [16, 5, -1, 4, 12, 17, 3, 10, 5, 9]. After the first pass through the numbers, what value would appear on the right of the list? choose one A. 16 B. 17 C. 9 D. -1 - ANSWER-B. If you encrypt the word "Hello" using the Caesar Cipher with a shift of 2, what secret message would you get? choose one A. OLLEH B. JHMMP C. IFMMP D. JGNNQ - ANSWER-D. Thirty students registered for a field trip. When the bus arrives, the students randomly line up to board the bus, but their teacher needs to take attendance using a list containing the students' names in alphabetical order by last name. Two different algorithms are given for finding each student's name as they board the bus. Algorithm 1: Repeat until the name is found or until you run out of names in the list. Look at the middle name in the list. If the name in the list is too high, cut off the top half of the list. If the name in the list is too low, cut off the bottom half of the list. If the name in the list matches the student's name, mark the student present. Algorithm 2: Let the current name be the first name on the list. Repeat until you find the name in the list. If the current name matches the student's name, mark the student present and stop. Otherwise, make current name the next name in the list. Which of the following statements is true? choose one. A. Algorithm A always finds the student's name, but Algorithm B doesn't. B. Algorithm B always finds the student's name, but Algorithm A doesn't. C. Both always find the student's name. D. Neither find the student's name. - ANSWER-C. In event driven programming, and event causes some piece of code to be executed. Which of the following would be considered an ad vent on your smart phone? Choose two. A. The phone receive the text message B. The phone place a ringtone C. The phones screensaver changes D. The phones location changes - ANSWER-A., D. If the following code were executed, what value would x have after button one is clicked once? X-100 When Button1. ClickedDoX- X+1. Choose one. A. 99 B. 100 C. 101 D. 1 - ANSWER-C. MysteryProcedure X-hits/hits + misses Which of the following statements correctly describes the calculation being done by the block of code above. Choose one. A. Calculates the number of hits divided by misses B. Calculates the total number of misses C. Calculates the total number of hits and misses D. Calculates the rate of hits out of all attempts - ANSWER-D. X-random 9,11 What possible values would be assigned to X if the code above was executed? Choose one. I. 9 II. 10 III. 11 A. I only B. I or II only C. I or III only D. I, II, or III - ANSWER-D. Coin-random 1,1 If coin=1 Display in Label1 "Heads" Else Display in Label1 "Tails" Which of the following best describes the result of running the code above? Choose one. A. The word heads would be displayed in label one B. The number one would be displayed in label one C. The word tails would be displayed in label one D. The number two would be displayed in label one - ANSWER-A. Move_forward Move_forward Rotate_right Move_forward Rotate_right Move_forward Move_forward Rotate_right Move_forward Rotate_right Assuming the move forward tells the android to move forward by 10 pixels and rotate right tells it to turn right by 90° what shape would be drawn by the algorithm above when executed with the pen down? Choose one. A. A square B. A right angle C. A rectangle D. A pentagon - ANSWER-C. Suppose in addition to move forward and rotate right, as defined in the previous question, your language includes a repeat N times block that will repeat a set of code N number of times. which algorithm would correctly draw a square? I. Repeat 4 times {rotate_right } Move_forward II. Repeat 4 times {move_forward Rotate_right } III. Repeat 4 times {Move_forward } Rotate_right Choose one: A. I only B. II only C. III only D. I and II only - ANSWER-B. K-1 Repeat until K5 Move_forward 100 Rotate_right 72 K - K+1 Which of the following best describes the results of running the above code? Choose one. A. A square with sides of length 100 pixels will be drawn B. A triangle with sides of length 75 pixels will be drawn C. A pentagon with sides of length 75 pixels will be drawn D. A pentagon both sides of length 100 pixels will be drawn - ANSWER-D. An app is designed to send text messages to members who are a part of a members list using their phone number. This app because the send message method which sends a set text message to the current phone number. Phone number - "5" textMessage - "See you soon"
Document information
- Uploaded on
- December 23, 2022
- Number of pages
- 11
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers