aklquiz 2&3
The conditional AND operator in Java, C++, and C# consists of ____.
&&
If X is true, Y is true, and Z is false, which of the following expressions is true?
X AND Y OR Z
A series of nested if statements is also called a ____ if statement.
cascading
For convenience, many programming languages allow two supplemental structures—the do loop and the ____ structure.
case
A ____ is created when you need to ask multiple questions before an outcome is determined.
compound condition
structures are attached end-to-end.
connecint wrong
In any Boolean expression, the two values compared can be either variables or ____.
constants
A(n) ____ is any numeric variable you use to count the number of times an event has occurred.
counter
Some loops are controlled by reducing, or ____.
decrementing
To indicate end-of-file, use the ____ indicator.
eof
In structured programs, structures can be stacked or connected to one another only at their entry point or ____.
exit point
A ____ can contain any number of tasks, but there is no chance to branch off and skip any of the tasks.
sequence
Case-Based Critical Thinking Questions Case 1 You are making your favorite cookie recipe. You have all the ingredients on hand. You follow the recipe step by step. This is an example of a ____ structure.
sequence
Each part of an expression that uses an AND operator is evaluated only as far as necessary to determine whether the entire expression is true or false, this feature is called ____ evaluation.
short circuit
Many programmers prefer starting their counted loops with a variable containing a(n) ____ value.
0
Case-Based Critical Thinking Questions Case 1 The YumYum store sells ice cream. Single-scoops cost $2.00, double-scoops cost $2.80, and triple-scoops cost $3.50. No matter how many scoops a customer chooses, when a customer also decides that they want the ice cream served in a cone, there is an additonal 50 cent charge. In order to correctly charge for the ice cream served in a cone, you would use a(n) ____.
AND
Case-Based Critical Thinking Questions Case 1 The YumYum store sells ice cream. Single-scoops cost $2.00, double-scoops cost $2.80, and triple-scoops cost $3.50. Double-scoop orders account for about 50 percent of the sales; single-scoop orders account for 30 percent and only 20 percent of sales are triple-scoops. When you write a program to determine sales based on scoop size, you can make the most efficient decision by asking first whether the scoop size is ____.
Double
Many programs are not run at the command prompt in a text environment, but are run using a ____, which allows users to interact with a program in a graphical environment.
GUI
Which of the following is NOT a mistake that programmers commonly make with loops?
Including statements outside the loop that belong inside the loop
You use the logical ____ operator to reverse the meaning of a Boolean expression.
NOT
You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudocode. The following pseudocode is not working properly. The message should display 10 times. This is not working because the programmer made which common loop mistake? for count = 1 to 10 output "Hello" endfor
Neglecting to alter the loop control variable
You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudocode. The following pseudocode is not working properly. The message should display five times. This is not working because the programmer made which common loop mistake? Declarations
Neglecting to initialize the loop control variable
A(n) ____ is a variable that you use to gather or accumulate values.
accumulator
A group of statements that executes as a single unit is a(n) ____.
block
A ____ is one that represents only one of two states, true or false.
boolean
When several decisions are based on the value of the same variable, many programming languages offer a shortcut called the ____ structure.
case
A(n) ________ or unreachable path is a logical path that can never be traveled.
dead
A loop for which the number of iterations is predetermined is called a(n) ____ loop, or counted loop.
definite
Reports that include some output for every input record are ____ reports.
detail
A repetition or iteration loop is known as a(n) ____ structure.
do while WRONG while do
Case-Based Critical Thinking Questions Case 1 You are making your favorite cookie recipe. You have all the ingredients on hand.
dual alternative selection
Case-Based Critical Thinking Questions Case 1 You are making your favorite cookie recipe. You have all the ingredients on hand. You realize that the recipe has both the instructions for baking the cookies in the oven or the microwave. This is an example of a ____ structure.
dual-alternative selection
if-else examples can also be called ____, because they contain the action taken when the tested condition is true and the action taken when it is false.
dual-alternative selections
Programmers use the term "____" to describe programs that are well designed and easy to understand and maintain.
elegant
The endif and endwhile statements are know as ____ statements.
end-structure
You can use an ____ statement to clearly show where the actions that depend on a decision end.
endif
Any decision can be made using combinations of just three types of comparisons: _____.
equal to, greater than, and less than
In C++, Java, and C#, the ____ is the symbol used for the NOT operator.
exclamation point
In an AND decision, it is more efficient to first ask the question that is less likely to be ____.
false
The ____ statement uses a loop control variable and provides you with three actions automatically in one compact statement: initialization, evaluation and incrementation.
for
Years ago, programmers could avoid using structure by inserting a ____ statement into their pseudocode.
go to
Some programmers call structured programming ____ programming.
goto less
case-Based Critical Thinking Questions Case 1 The YumYum store sells ice cream. Single-scoops cost $2.00, double-scoops cost $2.80, and triple-scoops cost $3.50. There is a $10 bonus for ice cream store workers that have more than $100 of sales on their shift and sell more than four triple-scoop servings. What pseudocode will select the workers that will earn a bonus?
if Sales > 100 AND tripleScoop > 4
Which of the following pseudocode selects all people over 21?
if age > 21 then
The selection structure where the logic can flow only to one of the two alternatives, never to both is called a(n) ____ structure.
if then else
When a loop control variable is numeric, its value is often altered by ____ it, or adding to it.
incrementing
When one loop is nested within another, the loop that is contained is the ____ loop.
inner
A ____ is the structure that repeats actions while some condition continues.
loop
Case-Based Critical Thinking Questions Case 1 You are making your favorite cookie recipe. You have all the ingredients on hand. Every day, you bring two cookies to work until you run out of cookies at home. This is an example of a ____ structure.
loop
In a ____ structure, you continue to repeat actions while a condition is true.
loop
When you use a ____ within a computer program, you can write one set of instructions that operates on multiple, separate sets of data.
loop
The action or actions that occur within a loop are known as ____.
loop body
Structured programs can be easily broken down into routines or ____ that can be assigned to any number of programmers.
modules
The YumYum store sells ice cream. Single-scoops cost $2.00, double-scoops cost $2.80, and triple-scoops cost $3.50. To most efficiently keep track of the sales for each of the three serving sizes, you would use ____.
nested if statements using OR logic
Placing a structure within another structure is called ____.
nesting
The ____ is the location on your computer screen at which you type entries to communicate with the computer's operating system using text.
not input prompt
The ____ used in the pseudocode reflects the logic you can see laid out graphically in the flowchart.
not shape or color
You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudocode. The following pseudocode is not working properly. The message should display five times. What needs to be changed? declarations
num count = 0 should be added to the declarations
A(n) ____ is a value on either side of an operator.
operand
When one loop is nested within another, the containing loop is the ____ loop.
outer
Many programming languages allow you to use ____ to correct your logic when using ANDs and ORs and force the OR expression to be evaluated first.
parentheses
When you combine AND and OR operators, the AND operators take ____, meaning their Boolean values are evaluated first.
precedence
A ____ input is the statement that reads the first input value in a program.
priming
The purpose of the ____ input step is to control the upcoming loop.
priming
A ____ of values is every value between low and high limits.
range
When you use a(n) ____ check, you compare a variable to a series of values that mark the limiting ends of ranges.
range
In a loop, if the answer to the question results in the loop being entered and the loop statements executing, then the logic ____.
returns to the question that started the loop
The following pseudocode is an example of a ____ structure. if firstNumber is bigger than secondNumber then print firstNumber else print secondNumber
selection
Commonly, you control a loop's repetitions by using either a counter or a ____ value.
sentinel
The following pseudocode is an example of a(n) ____ structure. get firstNumber get secondNumber add firstNumber and secondNumber print result
sequence
With a(n) ____ structure, you perform an action or task, and then you perform the next action in order.
sequence
All logic problems can be solved using only the three structures—____.
sequence, selection, and loop
There are ____ relational comparison operators supported by all modern programming languages.
six
With a decision structure or ____ structure you ask a question, and, depending on the answer, you take one of two courses of action.
slection
The popular name for logically snarled program statements is ____ code.
spagethhit
Programs that use ____ code are so difficult to alter that when improvements are required, developers often find it easier to abandon the existing program and start from scratch.
spaghetti
One way to straighten out an unstructured flowchart segment is to use the "____" method.
spaghetti bowl
Case-Based Critical Thinking Questions Case 1 You are making your favorite cookie recipe. You have all the ingredients on hand. You make the cookies, following the instructions step by step and then deciding to either bake them in the oven or microwave. This is an example of ____.
stacking structures
A ____ is a basic unit of programming logic; each structure is a sequence, selection, or loop.
structure
Business reports that list no individual detail records, just totals, are called ____ reports.
summary
You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudocode. The following pseudocode is not working properly. The message should display 10 times. What needs to be changed?
the for statement should be: for count = 0 to 9 step 1
Programs that do not follow the rules of structured logic are ____ programs.
unstructured
Loops are frequently used to ____ data; that is, to make sure values fall within an acceptable or reasonable range.
validate
As long as a Boolean expression remains true, a ____ loop's body executes.
while
Every high-level computer programming language contains a ____ statement that you can use to code any loop, including both indefinite and definite loops.
while
C#, C++, C, and Java use the symbol ____ to represent the logical OR.
||