pg. 1 AP Computer Science Principles Final/AP Practice Questions with Correct Verified Answers – Latest Update 2024.
If the word between two conditions is or and the first condition is true, what will the result always be? - ANSWER - true If the word between the conditions is and and the first condition is false, what will the result always be? - ANSWER - false
What is a logic gate a part of? - ANSWER - a circuit
What are the parts of a logic gate? - ANSWER - two boolean inputs and one boolean output
What are the three major components of any algorithm? - ANSWER - selection, sequencing, iteration
When is iteration used in an algorithm? - ANSWER - when you want to repeat something
Give three examples of a time when you would use iteration in an algorithm. - ANSWER - you want to do something a certain number of times you want to do something until a condition is true you have a collection of data and you need to see each element in the collection
What is a collection of items of the same type? - ANSWER - a list
What is an index in a list? - ANSWER - the location in the list where an item can be found
What is an item in a list? - ANSWER - one element of the list
- / 3
pg. 2 What happens if you try to access and element that is outside of the list? - ANSWER - an error is returned
What is the smallest list index? - ANSWER - 1
What is the largest list index? - ANSWER - the length of the list
What are the three ways you can add elements to a list? - ANSWER - initialize from a list of values, add one element at a time to the end of the list (append item), add one element at a time to a specific location in the list (insert item)
How do you remove items from the list by their location? - ANSWER - by using the REMOVE command
What happens when elements are added or removed from a list? - ANSWER - the length of the list is automatically adjusted
What is a way to manage a group os instructions in a program? - ANSWER - a procedure
What do you have to do to call a procedure without receiving an error message? - ANSWER - include the name of procedure and the correct number of parameters
What does the robot data type do? - ANSWER - gives you a way to move around a two dimensional grid
With robot programming, where does the triangle point? - ANSWER - the way the robot is facing
What does it mean when part of the grid is filled in black? - ANSWER - the robot cannot move here
What does it mean when part of the grid is filled in gray? - ANSWER - the robot is trying to go here
What is a series of steps to execute a behavior in a program? - ANSWER - an algorithm 2 / 3
pg. 3
Why are algorithms studied? - ANSWER - for efficiency
Why are algorithms developed? - ANSWER - to understand or solve problems
What are algorithms the actions of? - ANSWER - program
What can every algorithm be created using? - ANSWER - sequencing, selection, or iteration
What can correct algorithms be combined to do? - ANSWER - make stronger code
Given one problem, what could be true in regards to algorithms? - ANSWER - there could be more than one algorithm that could solve it
True or false: If you can write an algorithm in one language, you can write it in most other languages - ANSWER - true
If you know that an algorithm works, what can you do? - ANSWER - use it in more than one place
What are the three characteristics of readable algorithms? - ANSWER - names of procedures and variables related to the problem repeated code is managed using a procedure coding blocks are reasonable in size
What can procedures also be called? - ANSWER - methods or functions
What are the two things you need to write code? - ANSWER - a programming language and a development environment
What needs to be good to be able to test code behavior? - ANSWER - your syntax
- / 3