What is a variable?
A named storage in the memory of a device.
What is sequencing and give an example.
It is a step-by-step order in which code runs. An example of sequencing is setting a variable to a specific number and then performing a mathematical operation using the variable, such as adding 5 to it.
What are Booleans?
They are a data type that can only have the values of true or false.
What is a procedure?
It is reusable blocks of code that perform specific actions, letting the code be more simple.
What is algorithm efficiency?
Algorithmic efficiency measures how resource usage (usually time/steps) grows as input size increases.
What is data abstraction?
Simplifying data to make it more applicable to more areas.
What is selection and give an example.
Selection is conditionals that determine which code should be executed. If/then/else statements are an example of selection.
What are conditionals?
They are if/then/else statements.
What is procedural abstraction?
Procedural abstraction is using procedures to make the code more simpler. It makes code more simpler because the code segment is being reused.
What is an undecidable problem?
A problem for which it is impossible to construct an algorithm that always leads to a correct answer for all possible inputs.
What is a string?
It is an ordered sequence of text in quotation marks. The text includes numbers, letters, spaces, and symbols.
What is iteration and give an example.
The repetition of specific code that is repeated a specific number of times. Loops are an example of iteration.
Name the types of errors.
Syntax, logic/semantic, overflow, and runtime
What is a library?
They are a collection of pre-written procedures and tools that can be imported and used in your program.
What is heuristic?
It is a good enough solution to a problem when finding the best possible solution would take too long or would be impossible to find.
What is a list?
It is an ordered collection of data items stored in one variable. This helps manage complex data and help it be more abstract.
What is the bubble sort?
It is a simple sorting algorithm that works by repeatedly stepping through a list, comparing adjacent elements, and switching them if they are in the wrong order.
Describe each type of error.
Syntax Error: A mistake in the spelling or grammar of a program that violates the rules of the programming language, preventing it from running.
Logic/Semantic Error: An error in the logic, but doesn't violate any rules. For example, setting the variable to 1 instead of 2.
Runtime Error: A mistake that causes a program to crash or not work unexpectedly while running, even if the code looks like it is syntactically correct. An example is dividing by zero.
Overflow Error: It occurs when a calculation produces a number that is too big to fit within the allocated bits, resulting in data that isn't correct.
Give an example of a library.
The blue math blocks in the math drawer in MIT App Inventor are built-in libraries since you just use those blocks in your code, and the program does the math by itself without the user having to know the code to perform mathematical operations.
Give an example of an undecidable problem.
The Halting Problem
What is an index?
It is a numerical value that represents a specific position of an item in a list.
What are the two different types of searches, and what do they do?
The linear search searches through every item in a list until the target item is found. It is good for unsorted data sets. The binary search divides the data set by half each time until the target item is found. It is good for sorted data sets.
What are nested conditionals?
Conditionals inside another conditional, which is an if/then/else statement inside another if/then/else statement.
How are libraries helpful?
They provide pre-written, tested code that allows programmers to save time.
Give an example of a heuristic problem.
Traveling Salesperson Problem