• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 14 pages
Exam (elaborations)

AP Computer Science Principles

Document preview thumbnail
Preview 2 out of 14 pages

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 What happens if you try to access and element that is outside of the list? an error is returned What is the smallest list index? 1 What is the largest list index? the length of the list What are the three ways you can add elements to a list? 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? by using the REMOVE command What happens when elements are added or removed from a list? the length of the list is automatically adjusted What is a way to manage a group os instructions in a program? a procedure What do you have to do to call a procedure without receiving an error message? include the name of procedure and the correct number of parameters What does the robot data type do? gives you a way to move a


Document information

Uploaded on
June 2, 2024
Number of pages
14
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
1
Followers
0
Items
1124
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions

Whoops! We can’t load your doc right now. Try again or contact support.