Unit 4: Iteration Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

.equals(String string)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

.length()

A

A method that is used to find the length or number of characters in a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

.substring(int index)

A

A method that is used to extract and return part of a string starting from the specified index position.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

2D Arrays

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Boolean Expression

A

A statement that evaluates to either true or false. It typically involves the use of comparison operators (such as ==, <, >) and logical operators (such as &&, ||).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Complex Algorithms

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Control Structures

A

Programming constructs that determine the flow of execution in a program. They allow you to make decisions and repeat actions based on certain conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Exam Weighting

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

For Loop

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Iteration

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Iteration Statement

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Loop Conditions

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Loops

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Nested For Loops

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Nested if statements

A

Conditional statements that are placed inside another conditional statement. They allow for more complex decision-making by checking multiple conditions within each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Return Statement

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Reversing a String

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

String Methods

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

String Traversals

A

Refer to the process of accessing and examining each character in a string. It involves iterating through the characters one by one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Tracing

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

while loop

A

A control flow statement that allows a block of code to be executed repeatedly as long as a specified condition is true.

22
Q

Write Methods

A

Refers to the process of creating reusable blocks of code that perform specific tasks. These methods can be called multiple times throughout a program, making the code more organized and efficient.

23
Q

Boolean Statement

A

An expression that evaluates to either true or false. It is used in programming to make decisions and control the flow of a program.

24
Q

Break statement

A

Used in loops (such as for and while loops) and switch statements to terminate their execution prematurely. It allows programmers to exit out of these constructs before reaching their natural end.

25
Q

Counter

A

A variable that keeps track of a value, usually used to count or iterate through a loop.

26
Q

divisibility modulo

A

Divisibility modulo refers to determining whether one number is divisible by another using modular arithmetic. It involves calculating the remainder when dividing one number by another.

27
Q

Exception Handling

A

A mechanism in programming that allows you to handle and manage errors or exceptional situations that may occur during the execution of a program. It helps prevent the program from crashing by providing alternative paths or actions when an error occurs.

28
Q

finally block

A

A section of code that follows a try-catch block and is always executed, regardless of whether an exception occurs or not. It is commonly used to perform cleanup tasks or release resources.

29
Q

Flag

A

In programming, this is a variable or condition that acts as a signal or indicator. It helps control the flow of execution within a program.

30
Q

Infinite Loop

A

A programming construct where a set of instructions keeps repeating indefinitely, causing the program to get stuck and not progress further.

31
Q

Loop Body

A

Refers to the block of code that gets executed repeatedly in a loop. It contains the instructions that are repeated until the loop condition becomes false.

32
Q

NumberFormatException

A

An exception that occurs when you try to convert a string into a numeric type (like int or double), but the string does not have the appropriate format for conversion.

33
Q

Scanner class

A

A built-in Java class that allows users to read input from various sources, such as the keyboard or a file.

34
Q

ArrayList

A

A dynamic data structure that allows you to store and manipulate collections of objects. Unlike arrays, ArrayLists can grow or shrink dynamically as needed.

35
Q

Arrays

A

A collection of elements of the same data type, stored in contiguous memory locations. They have a fixed size and can be accessed using an index.

36
Q

Conditional Expression

A

A statement that evaluates to either true or false based on the condition provided. It is commonly used in decision-making structures like if statements and loops.

37
Q

Incrementer

A

An operator used to increase the value of a variable by one. It’s commonly used in loops and counting scenarios.

38
Q

System.out.println

A

A Java statement used to display output on the console. It prints the specified message or value and adds a new line character at the end.

39
Q

Traverse

A

Refers to the process of accessing each element in a data structure (such as arrays or linked lists) one by one, usually for performing some operation on them.

40
Q

Equals Method

A

A method in Java that is used to compare two objects for equality. It checks if the values of the objects are the same, rather than comparing their memory addresses.

41
Q

Loop Increment

A

The step in programming where variables are updated or modified after each iteration of a loop. It determines how the loop progresses and when it will eventually terminate.

42
Q

Loop Initialization

A

The step in programming where variables are assigned initial values before entering a loop. It sets up the starting conditions for the loop’s execution.

43
Q

Reverse

A

To change the order of its characters, so that the last character becomes the first, the second-to-last becomes the second, and so on.

44
Q

Sliding Window

A

A technique used in computer science and algorithms where a fixed-size window moves through an array or string to perform operations on subarrays or substrings. It allows for efficient processing of data by avoiding redundant calculations.

45
Q

boolean

A

A data type that can only have two possible values – true or false. It is often used in programming to make decisions and control the flow of a program.

46
Q

Continue

A

A keyword used within loops (such as for or while loops) to skip the rest of the current iteration and move on to the next one. It allows you to control which iterations should be executed based on certain conditions.

47
Q

Nested Iteration

A

Refers to the process of using one loop inside another loop. This allows for repeated execution of a block of code within another block of code.

48
Q

prime number

A

A positive integer greater than 1 that has no positive divisors other than 1 and itself. In simpler terms, it’s a number that cannot be evenly divided by any other numbers except for 1 and itself.

49
Q

System.out.print

A

A Java statement used to display output on the console. It allows you to print text or values directly to the standard output stream.

50
Q

Zero-based indexing

A

A numbering system where the first element in an array or list is assigned index 0 instead of 1. This means that elements are accessed by their position relative to zero.

51
Q

Nested For Loop

A

A loop structure where one loop is placed inside another loop. It allows for the repetition of a set of instructions within another set of instructions, resulting in more complex and controlled iterations.

52
Q

Variables

A

Named storage locations in computer memory that hold values which can be changed during program execution.