The main function of data abstractions
What is managing complexity for programs?
This Boolean operator returns true only if both conditions are true
What is the AND Operator?
The purpose of an "if" statement in a program
What is To control whether a block of code runs based on whether a condition is true?
Algorithms that can solve some intractable problems, prioritizing efficiency
What is a heuristic algorithm?
Categorizing by using organization to order values in different ways
What is a Sort?
Strategy used to manage complexity
What is a List?
This operator inverts the truth value of a Boolean expression
What is the NOT Operator?
The statement used to run the alternative code if the "if" statement is false?
What is "else"?
What is an efficient algorithm?
an algorithm that produces the correct answer quickly, while also occupying the least amount of memory
Proved that undecidable problems exist in the 1930s
Who is Alan Turing?
An ordered sequence of characters
What is a String?
What Boolean expression determines if the value x is between 10 and 20. (inclusive range)
x >= 10 AND x<= 20
What will the code display?
temperature ← 85
if (temperature > 90) {
DISPLAY("It's hot!")
}
DISPLAY ("Have a nice day!")
What is "Have a nice day?"
A photographer wants to save high-quality pictures for editing in the future without losing any data. Should they use lossy or lossless compression? Why?
Lossless compression because it preserves all the original data and makes it suitable for editing and future use.
Repeating a program statement a specified number of times or until a given condition is met
What is Iteration?
Which is a type of list. Pick two
A. 24568world
B. Contacts in your phone
C. Hello23Time
D. Playlist of songs
What are B and D?
The Diagram Below shows an AND Gate
A ---
AND
B ---
If the output wire is off(0), what are the possible states of the input wires?
What is 00, 01, 10?
What is the output of the code?
x←7
if (x<5) {
DISPLAY ("A")
} else {
DISPLAY ("B")
}
What is "B"?
In what way is multi-factor authentication more secure than using just a password?
A) It requires 2 or more pieces of evidence to verify identity, reducing the risk of unauthorized access.
B) It only uses biometric data, which is harder to steal than a password
C) It stores passwords in an encrypted format, making them unhackable
D) It uses a password that changes every 60 seconds, preventing unauthorized logins
What is "A"?
Difference between linear and binary search
Linear goes through the list one by one and is used when the list is not sorted. Binary starts from the middle and decides where to go next based on feedback. It requires a sorted list.
Benefits of managing complexity. Pick two
A. Keep track of customers in a line to check online
B. Prevent the same number to be entered for exam scores
C. Keep track of every button click in a day
D. Curve every value by 2 points for a set of exam scores
What are A and D?
What does NOT (A OR B) mean
NOT A AND NOT B
What is the output?
x←8
y←5
if (x>5) {
if (y<3) {
DISPLAY ("A")
} else if (y<6) {
DISPLAY("B")
} else {
DISPLAY ("C")
}
} else {
DISPLAY ("D")
}
What is "B"?
Why do secure websites use asymmetric encryption first, but then switch to symmetric encryption?
Asymmetric encryption is slower, so it's used to safely share a secret key, and then symmetric encryption is used because it's much faster for sending actual data.
How a list manage complexity in a code
It stores a lot of values in 1 variable. This improves readability, and makes making changes easier.