Unit 4: Iteration Flashcards
.equals(String string)
A method that is used to compare two strings for equality. It checks if both strings have exactly the same characters in the same order.
.length()
A method that is used to find the length or number of characters in a string.
.substring(int index)
A method that is used to extract and return part of a string starting from the specified index position.
2D Arrays
Data structures that store values in a grid-like format with rows and columns. They allow for the organization and manipulation of data in a two-dimensional manner.
Boolean Expression
A statement that evaluates to either true or false. It typically involves the use of comparison operators (such as ==, <, >) and logical operators (such as &&, ||).
Complex Algorithms
Sets of instructions or procedures designed to solve intricate problems or perform complex tasks. They often involve multiple steps, decision-making processes, and data manipulation techniques.
Control Structures
Programming constructs that determine the flow of execution in a program. They allow you to make decisions and repeat actions based on certain conditions.
Exam Weighting
Refers to the allocation of points or marks given to each section or topic in an exam. It determines how much each part contributes to the overall score.
For Loop
A control flow statement that allows you to repeatedly execute a block of code for a specified number of times or until certain conditions are met.
Iteration
Refers to the process of repeating a set of instructions multiple times in order to achieve a desired outcome. It allows for efficient execution of repetitive tasks without having to write redundant code.
Iteration Statement
Also known as a loop, allows for repeated execution of a block of code based on a specified condition. It helps automate repetitive tasks and saves time.
Loop Conditions
The conditions that determine whether a loop should continue executing or stop. They are typically expressed as boolean expressions and are evaluated before each iteration of the loop.
Loops
Control structures in programming that allow you to repeatedly execute a block of code until a specified condition is met. They provide an efficient way to perform repetitive tasks without writing redundant code.
Nested For Loops
A way to repeat a set of instructions multiple times within another loop. It allows you to iterate over elements in a multi-dimensional data structure, such as a 2D array.
Nested if statements
Conditional statements that are placed inside another conditional statement. They allow for more complex decision-making by checking multiple conditions within each other.
Return Statement
Used in functions/methods to specify what value should be sent back as output when the function is called. It terminates the execution of a function and returns control back to where it was called from.
Reversing a String
Changing the order of its characters so that the last character becomes the first, the second-to-last character becomes the second, and so on.
String Methods
Built-in functions in programming languages that allow manipulation and processing of strings (sequences of characters). They provide useful operations such as finding substrings, replacing characters, converting case, and more.
String Traversals
Refer to the process of accessing and examining each character in a string. It involves iterating through the characters one by one.
Tracing
Refers to the process of following the execution of a program step by step to understand how it works and identify any errors or bugs.