APCSP MidTerm Review
Halima is making a multiple choice quiz to practice for the UIL Mathematics competition. For each question the player answers correctly (a), they earn 6 points. They lose 2 points for each question they answer incorrectly (b). She also adds 1 bonus point for every minute left before the 15-minute timer runs out (c). Which answer choice correctly shows how to calculate the player's final score?
( ( (6*a) - (2*b) ) + c)
What value would the code sequence below display? Set Q to 9 Set H to 8 Set V to Q Set N to V minus H DISPLAY(N)
1
Which of the following does NOT correctly complete the block below? Does Word have Num Letters
2 ifs
Consider the following procedure named Mystery: PROCEDURE Mystery(numberList, targetNumber){counter ← 0FOR EACH number IN numberList{IF(number > targetNumber){counter ← counter + 1}}RETURN(counter)} What would be the result of running the following lines of code? myMathGrades ← [100, 80, 90, 80, 60, 100, 50, 100]Mystery(myMathGrades, 60)
6
a ← 6c ← ab ← 3b ← ca ← 4DISPLAY(c)What will the code display?
6
What is the difference between a code segment and a code statement?
A code segment refers to a collection of statements within a program, while a code statement is the part of the code that carries out the action.
John is trying to use a data abstraction in a program to finish the lab he is working on. What is the purpose of abstraction, and how does it fulfill its purpose?
Abstraction is a method of organizing data in a program so that it is easier to understand, access, and use the data. This is done by making a line of code that takes unformatted, raw data as an input, and stores that data in a specified, organized format, and by making more lines of code that can extract specific parts of this data for the programmer's desired purpose.
What is bandwidth and how is it usually measured?
Bandwidth is the maximum amount of data that can be sent in a fixed amount of time. It is measured in bits per second.
What is recursion?
Calling a procedure from inside itself.
Which real world example does not illustrate bias in AI programming development ?
Certain Laws not applying for Robots and AI
Emma is writing a program that will draw a cupcake on a plate. She doesn't want the all the cupcakes the program draws to look the same, so she has the program choose a between 2 types (i.e. color, shape, size) of each component (i.e. frosting, cake, topping). Here is her code for her reporter, "frosting choice", which chooses between chocolate and vanilla frosting: If (pick random 1 to 5) = 3 report "vanilla"Elsereport "chocolate" Emma doesn't like the vanilla to chocolate ratio produced by her program. How can she increase the frequency at which the program chooses vanilla frosting?
Change the 5 to a 4
Which of the following is NOT an example of Personally identifiable information(PII)?
Childhood pet's name
Which of the following is not a way to generate an event?
Clicking the footsteps button
Alice and Bob are working together on a team project. Which of the following is NOT a benefit that comes from collaboration with others?
Collaboration causes an increase in bias
All of the following are considered "fair use" in copyright laws EXCEPT...
Copying a Title
Which one of these situations is not 'fair use' and could be interpreted as plagiarism?
Copying and pasting from the Wikipedia
If Lypdette wants to implement abstraction in her program which is about creating a contacts list, which of the following could be a way to do this?
Create a datatype for contacts and use selectors to select specific information from contacts
Daisy and Tom are arguing about whether one should connect to the internet using a browser or using one's phone. Daisy says that one should use a browser as that protects the privacy of an individual more, but Tom says that a phone protects privacy more than a browser. Which of these is a valid argument?
Daisy because one can install privacy extensions in a browser that restrict access to information
In binary, what does each added bit do to the number of values that can be represented?
Doubles it
What type of programming executes program statements when they are triggered?
Event-driven programming
In creating a game like Tic-Tac-Toe, why would abstraction be preferable for creating the grid? I. The code is easier to read and debug II. If you later decide to change the tiles, it will be simpler to change them all III. It makes the creation run faster
I and II only
Copyright protection is available for I. Literary work II. Musical work III. Artistic work
I, II, and III
Which of these are considered to be good personal security practices online? I. Be cautious when downloading content or clicking links, especially free content from untrustworthy sites or spam/unsolicited messages II. Keep all software (including but not limited to; your computer's Operating System, hardware drivers, and applications) up-to-date III. Use a password that is something that you are known for publicly so that you can easily remember it IV. Never give your password or other login information out publicly
I, II, and IV only
How have recent advancements in technology affected the medical world?
The development of surgery performing robots and other telemedical services allow doctors to aid patients from separate locations.
Which of the following is an example of event-driven programming?
The space key is pressed, triggering a script that causes the sprite to move forward 50 steps
Which of the following can be represented using analog data?
The speed of a runner
When will [condition1 OR condition2] evaluate to false? I. condition1 is true and condition2 is true II. condition1 is true and condition2 is false III. condition1 is false and condition2 is true IV. condition1 is false and condition2 is false
IV
Which of the following is not an advantage of storing data using cloud computing?
Improved security and privacy over storing data on a personal computer.
What does procedural abstraction accomplish? Choose the best answer.
It allows the solution for a larger problem to be based on the solutions for a few smaller sub-problems.
Suzie wants to begin working from home. Which of the following is NOT a true benefit of her working remotely and telecommuting?
It increases connectivity in the workplace between Suzie and her colleagues
Which is a benefit of abstraction?
It reduces the complexity of a topic and allows a person to focus on the larger idea.
Write code to select only the items from a list of numbers called nums that are either less than 2 or greater than 3.
Keep Items Less than 2 and Greater than 3 from Nums
Which of the following is a benefit of using a list as a data abstraction in a program?
Lists often allow their size to be easily updated to hold as many data values as needed.
Which of the following is an example of a computing innovation having an unintended positive effect on society?
Machine learning, an originally unintended offshoot from the study of artificial intelligence, has today become a diverse field that, among other things, improves efficiency and decision-making in areas such as business, medicine, and internet search engines.
Bryan is trying to clear his contact list without deleting any of his previous code in the scripting area. How can he clear the contact list in the simplest way possible?
Make a clear list block that sets the "contact list" variable to just an empty list
Under which of the following condition is the person legally allowed to use someone else's work?
Mr. Ewbank uses Snap ( Snap is under a creative commons license) to teach his students. He also credits the authors of Snap.
Katie is an expert hacker, but when she tries to hack into Olivia's TikTok account (for the clout) she encounters 2 steps of verification requiring the use of Olivia's phone and the name of Olivia's 1st grade teacher.What term is described above?
Multifactor Authentication
Suzie can only access her computer after presenting several pieces of evidence, including a question that asks what her first pet's name was. What term best describes this security measure?
Multifactor authentication
Consider the following code segment. a <-- 5b <-- 7c <-- aa <-- b REPEAT UNTIL(a > c) {display(c)c <-- c - a}What will this code segment display? If there is an infinite loop, select that answer choice.
Nothing will Display
Which of the following is a term for material that is publicly available for people to view, modify, and distribute as they see fit?
Open source
A program that runs 4 bits to represent whole numbers runs a program that adds the numbers 10 and 6. Although this is added the result of the number gives back 0. Why is this occurring?
Overflow error
Siddhu received an email from Later Haters CPHS Co. stating he had won a million-dollar lottery! In order to claim his money, Siddhu entered his social security information for identification purposes and bank information for money wiring purposes.Which term is best describes the situation above?
Phishing
What is the difference between a copyright violation and plagiarism?
Plagiarism is taking credit for someone else'e work. A copyright violation is not giving credit to the correct sources.
A procedural abstraction...
Provides knowledge of what the process does, not how it does it.
Ada is on a public discord chat, and she wants to play Among Us only with APCSP Students (no strangers!!) so she sends an encrypted game code using her private key along with each of the APCSP students' public keys. The APCSP students use their private keys along with Ada's public key to decrypt and join the game.What method of encryption was used? Correct!
Public key encryption
Which of the following does lossless data compression NOT do?
Reduce the amount of information
Which of the following describes a situation that could raise ethical concerns in gathering and applying user data?
Search engines implementing user history to suggest specific search results to them.
What is an argument that search engines should be able to have access to search history from users?
Searches that users have made in the past may reveal illegal activity that otherwise would not be found.
Which of the following is a connectionless protocol that prioritizes speed over accuracy in the transfer of packets?
UDP
Which choice is NOT an example of a company in the on-demand economy?
USP
Given that Mickey Mouse, and the theming around him, is the intellectual property of Walt Disney Studios, how can Brad, an aspiring Disney-themed you-tuber, utilize Mickey in uploaded videos?
Upload a self-made, hand drawn and animated parody where Mickey Mouse sponsors Goofy in a court case (alleging petty larsony), using creative-commons-licensed audio.
Suzy is making a game in which she needs to keep track of a scare. She makes a global variable called 'score.' How can Suzy keep track of her score?
Use the command block "set (blank) equal to (blank)."
Which of the following is an example of program input?
Visual Audio Correct! All of these answers Tactile
After what action will the following script finish? When Flag Clicked repeat until Touching mouse pointer Point towards mouse pointer move 3 steps
When the sprite touches the mouse pointer
What is the importance of network redundancy?
Without network redundancy, the failure of one path or device could take down an entire network.
Clementine is debating whether or not she should add a global variable to her game. Should she, or should she not use one if the global variable would be used to keep track of necessary points in order to win?
Yes, because it would allow for that data to be translated throughout the entire program
Mary wants to create a game with a background that will make strobe lights that change her background from white to black or vice versa every second. Will the following achieve this? ForeverWait (1) secs Change (seconds) by 1 If ((seconds mod 2)=0)set background color to (white) else set background color to (black)
Yes, the script will set the background color to white on every even second and black on every odd.
What is the result of the following code segment? map Join Blank S over calculator bottle earbud
calculators, bottles, earbuds
Ella wants to create a code that makes it equally likely for it to report the words watermelon or apple. Which of these codes would achieve this?
if (pick random 1 to 4 > 2)Report (watermelon)ElseReport (apple)
Which type of compression would you typically use if you were sending a picture to your friend?
lossy
Joseph wants to create a nested triangle using the following script: nested triangle, size: X pen down If X > 9repeat (3)move (X) steps turn left 30 degrees turn right 150 degrees What segment of code should Joseph insert between the code segment: turn left 30 degrees turn right 150 degrees that utilizes the idea of recursion in order to have the script create a nested triangle? Note: A nested triangle creates smaller triangles inside of itself
nested triangle, size: X/2
What is the process that calls a block from inside itself, that we used when creating a nested image?
recursion
What does the expression a MOD b mean?
the remainder when a is divided by b