Podcast
Questions and Answers
Consider the pseudocode: x ← 2
, REPEAT 4 TIMES {x ← x * 3}
. What value is stored in x
after execution?
Consider the pseudocode: x ← 2
, REPEAT 4 TIMES {x ← x * 3}
. What value is stored in x
after execution?
- 162 (correct)
- 18
- 24
- 64
A wildlife research team is using 'citizen science' to analyze images from field cameras. What is a primary reason to use this approach?
A wildlife research team is using 'citizen science' to analyze images from field cameras. What is a primary reason to use this approach?
- A distributed group of individuals is faster and efficient at analysis. (correct)
- Image analysis always requires inherently complex methods.
- Citizens are always more accurate in species identification.
- Individual citizens provide analysis that is always more consistent.
Which software abstraction represents the highest level of abstraction?
Which software abstraction represents the highest level of abstraction?
- Boolean expression
- Procedure
- Software library (correct)
- Selection statement
An algorithm aims to generate the output: red red blue red red blue red red blue
. Which code segment achieves this?
An algorithm aims to generate the output: red red blue red red blue red red blue
. Which code segment achieves this?
Consider the domain names example.com
and cs.example.com
. Which correctly describes their relationship?
Consider the domain names example.com
and cs.example.com
. Which correctly describes their relationship?
A program adds two positive integers, resulting in an overflow error. Which statement best explains this?
A program adds two positive integers, resulting in an overflow error. Which statement best explains this?
A logic circuit contains OR, AND gates. For which input will it output TRUE?
A logic circuit contains OR, AND gates. For which input will it output TRUE?
Two robot programs aim to move a robot to a gray square. Program II uses GoalReached()
to check if the goal is achieved. Which statement best describes the programs?
Two robot programs aim to move a robot to a gray square. Program II uses GoalReached()
to check if the goal is achieved. Which statement best describes the programs?
What is the least likely benefit of using flight simulation software for pilot training?
What is the least likely benefit of using flight simulation software for pilot training?
Which set of actions are generally helpful in program development?
Which set of actions are generally helpful in program development?
Which method provides the most security when transmitting private data over the Internet?
Which method provides the most security when transmitting private data over the Internet?
Given ticket prices differing based on age and guided tour selection, which code segment correctly displays the ticket cost?
Given ticket prices differing based on age and guided tour selection, which code segment correctly displays the ticket cost?
Given an RGB triplet table, what color does (11111111, 11111111, 11110000) represent?
Given an RGB triplet table, what color does (11111111, 11111111, 11110000) represent?
Based on the information provided, what is the binary RGB triplet for the color indigo?
Based on the information provided, what is the binary RGB triplet for the color indigo?
A library database tracks book loans. What information cannot be determined from the data collected?
A library database tracks book loans. What information cannot be determined from the data collected?
An algorithm takes a positive integer and displays its digits from right to left, but a step is missing. What is that step?
An algorithm takes a positive integer and displays its digits from right to left, but a step is missing. What is that step?
Two programs display a sequence of numbers. What is the relationship in values they display?
Two programs display a sequence of numbers. What is the relationship in values they display?
Which of the following is not a way to enhance privacy while browsing the internet?
Which of the following is not a way to enhance privacy while browsing the internet?
A program aims to remove 'the' and 'a' from a wordList
, but it loops infinitely. What fixes it?
A program aims to remove 'the' and 'a' from a wordList
, but it loops infinitely. What fixes it?
Which data can be represented as a sequence of bits?
Which data can be represented as a sequence of bits?
A robot must move to a gray square, avoiding black areas. Given procedure GoalReached()
, what code drives the movement?
A robot must move to a gray square, avoiding black areas. Given procedure GoalReached()
, what code drives the movement?
How did registered users change over eight years since file storage application launched?
How did registered users change over eight years since file storage application launched?
What best describes the average amount of data stored per user over the first eight years?
What best describes the average amount of data stored per user over the first eight years?
Referring to the provided circle graph, what observations are supported?
Referring to the provided circle graph, what observations are supported?
A spinner’s regions are six times one region, and move the space one. Move two and loop see turn; which simulated segment has a result that matches?
A spinner’s regions are six times one region, and move the space one. Move two and loop see turn; which simulated segment has a result that matches?
Regarding cloud vs. local data storage, which statement is most likely true?
Regarding cloud vs. local data storage, which statement is most likely true?
A flowchart is used with conditional step-step where action happens from label else where happens variables set.
A flowchart is used with conditional step-step where action happens from label else where happens variables set.
To be having set having number binary having number to hexadecimal
To be having set having number binary having number to hexadecimal
Code loops, how to fix loop?
Code loops, how to fix loop?
What do bits explain?
What do bits explain?
Robot test needs it or in set step.
Robot test needs it or in set step.
Application year where do test all it test have go correct?
Application year where do test all it test have go correct?
Why test it all
Why test it all
Test what now at
Test what now at
How we will test code
How we will test code
We for new line is a
We for new line is a
Flashcards
Software library
Software library
A software abstraction considered the highest level. It is a collection of pre-written code and resources that perform common tasks, offering reusable functionality.
Citizen Science Approach
Citizen Science Approach
A method involving distributed individuals to analyze images.
Overflow Error
Overflow Error
A programming error that occurs when the result of an arithmetic operation exceeds the maximum value that a variable can hold.
Public-key encryption
Public-key encryption
Signup and view all the flashcards
Domain Name System (DNS)
Domain Name System (DNS)
Signup and view all the flashcards
Lossy Compression
Lossy Compression
Signup and view all the flashcards
Sharing copyrighted application
Sharing copyrighted application
Signup and view all the flashcards
Open-source software
Open-source software
Signup and view all the flashcards
Certificate authority
Certificate authority
Signup and view all the flashcards
Redundant Routing
Redundant Routing
Signup and view all the flashcards
Crowdsourcing
Crowdsourcing
Signup and view all the flashcards
Abstraction
Abstraction
Signup and view all the flashcards
Distributed Denial-of-Service (DDoS)
Distributed Denial-of-Service (DDoS)
Signup and view all the flashcards
Phishing
Phishing
Signup and view all the flashcards
Study Notes
- The 2020 AP Computer Science Principles Exam is 2 hours long with 74 multiple-choice questions.
- Programming reference materials are provided.
- The exam uses two programming formats, text-based and block-based.
- Programming instructions use numbers, Booleans, strings, and lists data types.
- Exam instructions might include assignment, display, and input, arithmetic operators, relational operators, selection, iteration, list operations, procedures and robots.
Assignment
- The instruction
a ← expression
evaluates the expression and assigns the result to variable a.
Display
- The instruction
DISPLAY (expression)
displays the value of the expression, followed by a space.
Input
- The instruction
INPUT ()
accepts a value from the user and returns it.
Arithmetic Operations
- +, -, *, and / are used to perform arithmetic on a and b.
- 3 / 2 evaluates to 1.5.
Modulo Operator
- The modulo operator gets the remainder when a is divided by b.
- Assumes that a and b are positive integers.
- 17 MOD 5 evaluates to 2.
Random Numbers
RANDOM (a, b)
can be used to generate random integers- Evaluates to a random integer from a to b, including a and b.
RANDOM (1, 3)
could yields 1, 2, or 3.
Relational and Boolean Operators
- Comparison operators =, ≠, >, <, , and evaluate the relationship between two variables, expressions, or values.
a = b
evaluates to true if a and b are equal; otherwise it evaluates to false.
NOT operator
NOT condition
will evaluate totrue
if the condition isfalse
, and vice versa
AND operator
condition1 AND condition2
will evaluate totrue
if both conditions are true, else to false.
OR operator
condition1 OR condition2
evaluates to true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true, evaluates to false otherwise.
Selection Instructions
IF (condition) { <block of statements> }
executes the code in block of statements if the Boolean expression condition evaluates to true; otherwise it will take no action.IF (condition) { <first block of statements> } ELSE { <second block of statements> }
executes the code in first block of statements if the Boolean expression condition evaluates to true; otherwise the code in second block of statements is executed.
Iteration Instructions
REPEAT n TIMES { <block of statements> }
executes the code in block of statements n times.REPEAT UNTIL (condition) { <block of statements> }
executes the code in block of statements is repeated until the Boolean expression condition evaluates to true.
List Operations
- If a list index is less than 1 or greater than the length of the list, an error message is thrown
list[i]
refers to the element of list at index i. The first element of list is at index 1.list[i] ← list[j]
assigns the value of list[j] to list[i].list ← [value1, value2, value3]
will assign value1, value2, and value3 tolist[1]
,list[2]
,andlist[3]
,respectively.FOR EACH item IN list { <block of statements> }
assigns the value of each element of list to the variable item sequentially, in order from the first element to the last, and th code in block of statements is executed once for each assignment of item.- INSERT (list, i, value) shifts values in list at indices equal or greater than i to the right. The length of list is increased by 1, and value is placed at index i in list.
- APPEND (list, value) increases the length of list by 1, and value is placed at the end of list.
- REMOVE (list, i) removes the item at index i in list and shifts to the left any values at indices greater than i. Length of list is decreased by 1.
- LENGTH (list) will find the number of elements in list.
Procedures
PROCEDURE name (parameter1, parameter2, ...){ <instructions> }
A procedure, name, takes zero or more parameters and and contains programming instructions.PROCEDURE name (parameter1, parameter2, ...) { <instructions> RETURN (expression) }
contains programming insructions and returns the value of expression, and the RETURN statement will cause an return back to the calling program.
Robot instructions
MOVE_FORWARD ()
will move the robot one square forward in the direction it is facing and if it attempts to move to a square will stay if it is beyond the edge of the grid and the program will terminate.ROTATE_LEFT ()
will rotate the robot 90 degrees counterclockwise (i.e., makes an in-place left turn) and if it attempts to move to a square will stay if it is beyond the edge of the grid and the program will terminate.ROTATE_RIGHT ()
will rotate the robot 90 degrees clockwise (i.e., makes an in-place right turn) and if it attempts to move to a square will stay if it is beyond the edge of the grid and the program will terminate.CAN_MOVE (direction)
evaluates to true if there is an open square one square in the direction relative to where the robot is facing; otherwise evaluates to false, with direction can be left, right, forward, or backward and it attempts to move to a square will stay if it is beyond the edge of the grid and the program will terminate.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.