Cmis 130 part 2
A ____ is one that represents only one of two states, true or false.
Correct Boolean expression
ase-Based Critical Thinking Questions Case 1 The Billing Department manager, Anna, asked the programmer, Jerry, for a list of customers who owe the ABC Company more than $500. When Jerry plans the solution to this programming problem, he will use one of two tools to help him. These tools are: ____.
Correct pseudocode and flowcharts
All logic problems can be solved using only the three structures—____.
Correct sequence, selection, and loop
What is TRUE about the following array? num someVals[5] = 1, 3, 5, 7, 9
Correct someVals[1] has the value of 3
If X > Y is false, which of the following is always true?
X <= Y
A(n) ____ is any numeric variable you use to count the number of times an event has occurred.
counter
A ____ can contain any number of tasks, but there is no chance to branch off and skip any of the tasks.
sequence
The ____ of a language are the rules that govern word usage and punctuation.
syntax
Given the flowchart above, how many times will the loop execute?
10
In the flowchart above, what is the fee for a dog that weighs 80 pounds?
105
Given the flowchart above, what would the output be?
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
Given the following pseudocode, how many times will the loop execute? Pseudocode: start Declarations num count = 1 while count <= 7 output "I love CMIS130" count = count + 1 endwhile stop
7
In the flowchart above, what is the fee for a dog that weighs 20 pounds?
75
Given the declarations for the flowchart above, what is price if patronAge = 60?
8.50
The decision that controls every loop is always based on a ____ expression.
Boolean
Case-Based Critical Thinking Questions Case 1 You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudocode. In the following pseudocode, what will be the value of sum after the code is run? Declarations num count = 0 num sum = 0 while count < 3 for X = 1 to 2 step 1 sum = sum + X endfor count = count + 1 endwhile
Correct 9
Given the declarations for the flowchart above, what is price if patronAge = 40?
FULL_PRICE
The indentation used in pseudocode impacts the flow of the statements; that is, the indentation affects whether or not a statement executes.
False
The ____ is a particularly convenient tool when working with arrays because you frequently need to process every element of an array from beginning to end.
For loop
The action or actions that occur within a loop are known as ____.
Loop Body
___ is the process of updating programs after the programs are put into production.
Maintenance
When you use a(n) ____ check, you compare a variable to a series of values that mark the limiting ends of ranges.
Range
A(n) ____, also called an index, is a number that indicates the position of a particular item within an array.
Subscript
Two primary uses of arrays in business applications are:
To produce totals; To provide a look-up table
All the variables in an array have the same data type and share a name.
True
When you combine AND and OR operators, the AND expressions are evaluated first.
True
In order to create an expression with a Boolean result, your expression must include:
a relational operator
A(n) ____ is a variable that you use to gather or accumulate values.
accumulator
A ____ search starts looking in the middle of a sorted list, and then determines whether it should continue higher or lower.
binary
When several decisions are based on the value of the same variable, many programming languages offer a shortcut called the ____ structure.
case
A loop for which the number of iterations is predetermined is called a(n) ____ loop, or counted loop.
definite
What is the loop control variable in the following pseudocode? input dep while not eof count[dep] = count[dep] + 1 input dep endwhile
dep
The ____ statement uses a loop control variable and provides you with three actions automatically in one compact statement: initialization, evaluation and incrementation.
for
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 lettered choices is equivalent to the following decision? if a > 10 then if b > 10 then output "OK" endif endif
if a > 10 AND b > 10 then output "OK"
A(n) ____ loop is a repeating flow of logic that never ends.
infinite
When you search sequentially through a list from one end to the other, you are performing a ____ search.
linear
Placing a structure within another structure is called ____.
nesting
Case-Based Critical Thinking Questions Case 1 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 string message = "OK" while count < 5 output message count = count + 1 endwhile
num count = 0 should be added to the Declarations
Case-Based Critical Thinking Questions Case 1 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 correctly. How should the for loop be changed? start Declarations num count = 0 num scores[6] = 0,0,0,0,0,0 num SIZE = 6 for count 0 to SIZE step input entry scores[count] = entry endfor stop
or count 0 to SIZE - 1 step 1
Case-Based Critical Thinking Questions Case 1 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 correctly. What kind of error is this? start Declarations num count = 0 num scores[6] = 0,0,0,0,0,0 num SIZE = 6 for count 0 to SIZE step 1 input entry scores[count] = entry endfor stop
out of bounds
A ____ input is the statement that reads the first input value in a program.
priming
In a loop, when the answer to the question results in the loop being entered and the loop statements executing, the logic then ____.
returns to the question that started the loop
A value such as "Y" or "N" that a user must supply to stop a loop is called a(n) ____ value.
sentinel
The following pseudocode is an example of a(n) ____ structure. get firstNumber get secondNumber add firstNumber and secondNumber print result
sequence
The following pseudocode is an example of a ____ structure. if on the beach use sunscreen endif
single-alternative selections
A ____ variable can hold letters of the alphabet and other special characters such as punctuation marks.
string
In an AND decision, it is more efficient to first ask the question that is less likely to be ____.
true
In an OR decision, it is more efficient to first ask the question that is more likely to be ____.
true
Given the flowchart above, what does this loop appear to be doing?
validating month