# Programming Design & Logic Quiz #2

Approved & Edited by ProProfs Editorial Team
At ProProfs Quizzes, our dedicated in-house team of experts takes pride in their work. With a sharp eye for detail, they meticulously review each quiz. This ensures that every quiz, taken by over 100 million users, meets our standards of accuracy, clarity, and engagement.
| Written by Dtull
D
Dtull
Community Contributor
Quizzes Created: 21 | Total Attempts: 94,718
Questions: 20 | Attempts: 283

Settings

.

• 1.

### A __________ _______ array is a search of a sorted array by repeatedly dividing the search interval in half.

Explanation
A binary search is a search algorithm that operates on a sorted array by repeatedly dividing the search interval in half. It starts by comparing the target value with the middle element of the array. If the target value is equal to the middle element, the search is successful. If the target value is smaller, the search continues on the lower half of the array. If the target value is larger, the search continues on the upper half of the array. This process is repeated until the target value is found or the search interval becomes empty.

Rate this question:

• 2.

### If you were to be in charge of sorting scores on a Pre-Calculus exam you would be creating an ____________ number array.

Explanation
In order to sort the scores on a Pre-Calculus exam, an integer number array would be created. This is because an integer array is capable of storing whole numbers, which are typically used to represent scores. By using an integer array, the scores can be easily sorted in ascending or descending order, allowing for efficient organization and analysis of the exam results.

Rate this question:

• 3.

### Computers process every single thing, so if ___________ goes in it will come out

Explanation
Computers are designed to process any input they receive, regardless of its quality or usefulness. In this case, if "garbage" goes into the computer, it will still be processed and produce an output. This implies that the computer does not have the ability to differentiate between valuable or worthless input, and will simply process and produce a result based on the input it receives.

Rate this question:

• 4.

### Used when a program needs to _______________ a process of one or more instructions until some condition is met.

Explanation
The correct answer is "repeat" because this keyword is commonly used in programming to indicate that a certain block of code should be executed repeatedly until a specific condition is met. It allows for the efficient implementation of loops, where the program can iterate over a set of instructions multiple times until the desired outcome is achieved. By using the "repeat" keyword, the program can control the flow of execution and ensure that the necessary instructions are repeated until the desired condition is satisfied.

Rate this question:

• 5.

### Any search you do online for a product or apparel that you want to buy will allow you to _________ your results by Price Low to High, Price High to Low, Best Seller, etc.

Explanation
When searching for a product or apparel online, you have the option to "sort" your results. This means that you can organize or arrange the search results in a specific order based on your preferences. Sorting options typically include sorting by price from low to high, price from high to low, best seller ranking, and other criteria that help you find the most relevant and suitable options for your needs.

Rate this question:

• 6.

### The _______ ________ loops is used with arrays to sort data out.

Explanation
The "for each" loop is used with arrays to iterate over each element and perform a specific action, such as sorting data. It allows for easy access to each element without the need for an index variable, making it a convenient choice for sorting arrays.

Rate this question:

• 7.

### The __________ loop sequence of instructions is one that is continually repeated until a certain condition is reached.

Explanation
A "while" loop is a sequence of instructions that is repeatedly executed as long as a certain condition is true. It allows the program to continue executing the same set of instructions until a specific condition is met, at which point the loop will stop. This type of loop is useful when you want to perform a task multiple times until a desired outcome or condition is achieved.

Rate this question:

• 8.

### ____________ is repetition in coding

Explanation
Iteration refers to the act of repeating a process or a set of instructions in coding. It allows the program to execute a block of code multiple times, either for a specific number of iterations or until a certain condition is met. This repetition is essential for performing tasks such as looping through arrays, iterating over lists, or executing a set of instructions until a desired outcome is achieved. By using iteration, developers can efficiently handle repetitive tasks and make their code more concise and dynamic.

Rate this question:

• 9.

### ______________ is an Automatic check to make sure data entered is sensible and reasonable.

Explanation
Validation is an automatic check that ensures the data entered is sensible and reasonable. It verifies if the input conforms to certain criteria or rules, such as data type, range, format, or consistency. This process helps to identify and prevent errors, inconsistencies, or invalid data from being entered into a system or database. By performing validation, the accuracy, integrity, and reliability of the data can be maintained, improving the overall quality of the information.

Rate this question:

• 10.

### If you created a program that listed the names of students in a class in alphabetical order the order would be listed in __________________ order

Explanation
If a program lists the names of students in a class in alphabetical order, the order would be listed in ascending order. This means that the names would be arranged from A to Z, or from the beginning of the alphabet to the end, in an increasing order.

Rate this question:

• 11.

### ____________ is a sorting algorithm that compares each adjacent number and swaps them until all of the numbers in the list are in order

Explanation
The given correct answer for this question is "Bubble". The bubble sort algorithm compares each adjacent number in a list and swaps them if they are in the wrong order. This process is repeated until all the numbers in the list are in the correct order.

Rate this question:

• 12.

### A ______________ is a special value in the context of an algorithm.

Explanation
A sentinel is a special value in the context of an algorithm. It is used to indicate the end of a data structure or the completion of a process. By using a sentinel, the algorithm can easily determine when to stop iterating or processing data. This special value acts as a marker or flag, allowing the algorithm to handle edge cases or special conditions efficiently.

Rate this question:

• 13.

### The ______________ statement causes execution to leave the current subroutine and resume at the point in the code immediately after where the subroutine was called.

Explanation
The "return" statement is used in programming to cause the execution of a subroutine or function to stop and return to the point in the code where it was called. This allows the program to resume execution from the line immediately after the subroutine call. In other words, it transfers control back to the calling function or program.

Rate this question:

• 14.

### A _____________ order are numbers or variables displayed in a decreasing fashion.

Explanation
A descending order is a way of arranging numbers or variables in a decreasing fashion. In this order, the highest value comes first, followed by the next highest value, and so on, until the lowest value is reached. This is the opposite of ascending order, where numbers or variables are arranged in an increasing fashion.

Rate this question:

• 15.

### A _______________ function produced an integer between 0 and whatever.

Explanation
A random function is a function that generates a random number or value. In this case, the random function produced an integer between 0 and some unknown upper limit.

Rate this question:

• 16.

### A _____________ loop is a loop within the loop

Explanation
A nested loop is a loop that is contained within another loop. It allows for the repetition of a set of statements multiple times within the execution of another loop. This can be useful when dealing with complex programming problems that require repetitive actions to be performed in a specific order. The use of nested loops allows for more intricate and detailed control over the flow of the program.

Rate this question:

• 17.

### _______________  are things that put numbers together or statements together. Such as *, /, +, -, %.

Explanation
The given correct answer is "Operators". Operators are symbols or characters used in programming to perform various operations on data or variables. They are used to combine numbers or statements and perform mathematical calculations or logical operations. Examples of operators include multiplication (*), division (/), addition (+), subtraction (-), and modulus (%). These operators help in manipulating and processing data in programming languages.

Rate this question:

• 18.

### A __________________ sort is a sorting algorithm, specifically an in-place comparison sort

Explanation
Selection sort is a sorting algorithm that works by repeatedly finding the minimum element from the unsorted part of the array and putting it at the beginning. It is an in-place comparison sort because it compares elements to determine their order and sorts the array by swapping elements within the array itself, without requiring any additional space.

Rate this question:

• 19.

### A ___________ provides a computer with a specific set of instructions to perform a task.

Explanation
A program is a set of instructions that provides a computer with a specific set of tasks to perform. It is a collection of code that tells the computer what actions to take in order to complete a particular task or achieve a specific goal. Programs can range from simple scripts to complex software applications, and they are essential for enabling computers to perform various functions and operations. Without programs, computers would not be able to execute specific tasks as they would lack the necessary instructions to do so.

Rate this question:

• 20.

### ___________________are notes made as reminders, instructions, etc. for a programmer that helps explains commands and instructions in code.

Explanation
Comments are notes made within code that serve as reminders, instructions, or explanations for the programmer. They are used to provide clarity and understanding about the purpose and functionality of specific commands or instructions in the code. Comments are not executed or interpreted by the computer and are purely for human readability. They are typically denoted by special symbols or syntax, depending on the programming language being used.

Rate this question:

Related Topics

×

Wait!
Here's an interesting quiz for you.