AP Computer Science Principles Final/AP Practice Questions and Answers 2024
What is a special data type that has one of two values? - a boolean What are the two values a boolean can have? - true or false What are the three ways a boolean can be returned? - as a result of evaluating a condition as a result of comparing two values when evaluating one or more Boolean conditions 10 MOD 2 - 0 20 MOD 0 - error 20 MOD 4 - 0 4 MOD 20 - 4 0 MOD 4 - 0 How can you determine if a number is even or odd? - by using x MOD 2, if the answer is 1, it is odd, if the answer is 0, it is even What are the two main reasons modulus is used in programming? - to determine if a number is odd or even to convert between number systems What is the opposite of less than? - greater than or equal to What is the opposite of greater than? - less than or equal to What is the opposite of is equal to? - is not equal to What is the opposite of is not equal to? - is equal to What is the opposite of greater than or equal to? - less than What is the opposite of less than or equal to? - greater than What is NOT (a AND b) equal to? - NOT a OR NOT b What is NOT ( a OR b) equal to? - NOT a AND NOT b If the word between two conditions is or and the first condition is true, what will the result always be? - true If the word between the conditions is and and the first condition is false, what will the result always be? - false What is a logic gate a part of? - a circuit What are the parts of a logic gate? - two boolean inputs and one boolean output What are the three major components of any algorithm? - selection, sequencing, iteration When is iteration used in an algorithm? - when you want to repeat something Give three examples of a time when you would use iteration in an algorithm. - 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? - a list What is an index in a list? - the location in the list where an item can be found What is an item in a list? - one element of the list
Written for
- Institution
- AP Computer Science
- Course
- AP Computer Science
Document information
- Uploaded on
- June 1, 2024
- Number of pages
- 24
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
- ap computer science
-
ap computer science principles finalap practice q
-
ap computer science principles
Also available in package deal