What is a data set?
A collection of related specific data used for analysis, training programs, or making decisions.
What does Integer.parseInt("42") return? Be PRECISE!
The int 42.
What is the index of the first element in an array or ArrayList?
0
What is the correct loop condition to avoid out-of-bounds errors when looping through an array named arr?
i < arr.length
What fruit used to be called a "Persian Apple"?
The peach
Why is it important to evaluate how a data set was collected before using it?
It may be biased, incomplete, or unrepresentative, leading to flawed conclusions.
What happens if Integer.parseInt() is used on a non-numeric string? Be PRECISE!
It throws a NumberFormatException.
What method is used to get the size of an ArrayList?
What is used to get the size of an array?
Array: .length
What does it mean to traverse an array?
To visit each element, usually using a loop.
What is the only country named after a woman?
St. Lucia
What is the difference between bias and algorithmic bias?
Bias is any unfair preference toward a group or outcome.
Algorithmic bias occurs when a program produces unfair results due to biased data.
What class is used to read data from a file line by line?
Scanner
What method replaces an element at a specific index in an ArrayList?
.set(index, value)
What should we do when we call the .remove() element in a standard for loop?
Why do we need to do this?
We must use i-- when we call remove()
We have to do this to make sure that we check the element that "slides" to the left to replace the removed element. If we did not use i--, we would go to the next index value and skip that element.
What two seas does the Suez Canal connect?
The Mediterranean Sea and the Red Sea
What is unintended data persistence?
Unintended data persistence is when data remains in a system after a user tries to remove it
What loop condition is commonly used to read all lines from a file?
while (scanner.hasNextLine())
or
while (scanner.hasNext())
What is the difference between .add(index, value) and .set(index, value)?
.add() adds a new element at that index (and slides all elements at that index and greater to the right by 1)
.set() replaces an existing element at that index and returns the element replaced.
Both are ArrayList methods.
What is printed?
int[] nums = {2, 4, 6};
for (int i = 0; i < nums.length-1; i++) {
System.out.print(nums[i] + " ");
}
2 4
What dinosaur's name means "Speedy Thief"?
Velociraptor
What is a data breach / unauthorized access?
A data breach is when hackers access a database and expose sensitive information; unauthorized access is when someone gains access to a user’s account or device without permission. (These may be the same thing)
What is the correct order of steps to read from a file? Answer in plain english / pseudocode.
Add the .txt file to the project
Import File and Scanner Classes
Create File Object
Create Scanner object that uses File Object
Loop through data with a while loop and Scanner object
Close Scanner.
Given: ArrayList<String> colors that contains "red", "yellow", "blue".
What will be the result from the code:
colors.set(3, "green")?
An IndexOutOfBoundsException occurs
What is printed?
int[] a = {1, 2, 3};
int[] b = {4, 5, 6};
for (int i = 0; i < a.length; i++) {
System.out.print(a[i] + b[i] + " ");
}
5 7 9
What is the longest word in the English language that contains just one vowel?
Strengths