UPDATED ACTUAL Exam Questions and
CORRECT Answers
What is a special data type that has one of two values? - CORRECT ANSWER - a boolean
What are the two values a boolean can have? - CORRECT ANSWER - true or false
What are the three ways a boolean can be returned? - CORRECT ANSWER - as a result of
evaluating a condition
as a result of comparing two values
when evaluating one or more Boolean conditions
10 MOD 2 - CORRECT ANSWER -0
20 MOD 0 - CORRECT ANSWER - error
20 MOD 4 - CORRECT ANSWER -0
4 MOD 20 - CORRECT ANSWER -4
0 MOD 4 - CORRECT ANSWER -0
How can you determine if a number is even or odd? - CORRECT ANSWER - 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? - CORRECT
ANSWER - to determine if a number is odd or even
,to convert between number systems
What is the opposite of less than? - CORRECT ANSWER - greater than or equal to
What is the opposite of greater than? - CORRECT ANSWER - less than or equal to
What is the opposite of is equal to? - CORRECT ANSWER - is not equal to
What is the opposite of is not equal to? - CORRECT ANSWER - is equal to
What is the opposite of greater than or equal to? - CORRECT ANSWER - less than
What is the opposite of less than or equal to? - CORRECT ANSWER - greater than
What is NOT (a AND b) equal to? - CORRECT ANSWER - NOT a OR NOT b
What is NOT ( a OR b) equal to? - CORRECT ANSWER - 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? - CORRECT ANSWER - true
If the word between the conditions is and and the first condition is false, what will the result
always be? - CORRECT ANSWER - false
What is a logic gate a part of? - CORRECT ANSWER - a circuit
What are the parts of a logic gate? - CORRECT ANSWER - two boolean inputs and one
boolean output
, What are the three major components of any algorithm? - CORRECT ANSWER -
selection, sequencing, iteration
When is iteration used in an algorithm? - CORRECT ANSWER - when you want to repeat
something
Give three examples of a time when you would use iteration in an algorithm. - CORRECT
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? - CORRECT ANSWER - a list
What is an index in a list? - CORRECT ANSWER - the location in the list where an item
can be found
What is an item in a list? - CORRECT ANSWER - one element of the list
What happens if you try to access and element that is outside of the list? - CORRECT
ANSWER - an error is returned
What is the smallest list index? - CORRECT ANSWER -1
What is the largest list index? - CORRECT ANSWER - the length of the list
What are the three ways you can add elements to a list? - CORRECT 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)