Visual Basic, C++, and Java are all examples of computer
C. programming languages
A programming language's rules are its
C. syntax
The most important task of a compiler or interpreter is to
A. translate programming language statements into machine language
Which of the following is temporary, internal storage?
A. memory
Which of the following pairs of steps in the programming process in the correct order?
B. code the program, translate it into machine language
A programmer's most important task before planning the logic of a program is to
A. understand the problem
The two most commonly used tools for planning a program's logic are
C. flowcharts and pseudocode
Writing a program in a language such as C++ or Java known as _________ the program.
B. coding
An English-like programming language such s Java or Visual basic is a ________ programming language.
C. high-level
Which of the following is an example of a syntax error?
C. misspelling a programming language word
Which of the following is an example of a logical error?
D. all of the above
The parallelogram is the flowchart symbol representing
C. either a or b
In a flowchart, a rectangle represents
A. processing
The term eof represents
A. a generic sentinel value
In flowcharts, the decision symbol is a
B. diamond
When you use an IDE instead of a simple text editor to develop a program,
D. some help is provided
When you write a program that will run in a GUI environment as opposed to a command-line environment,
A. some syntax is different
As compared to procedural programming, with object-oriented programming,
A. the programmer's focus differs
What does a declaration provide for a variable?
C. both of the above
A variable's data type describes all of the following except
D. the scope of the variable
The value stored in an uninitialized variable is
C. garbage
The value 3 is a
C. numeric constant
The assignment operator
A. is a binary operator
Multiplication has a lower precedence than
D. none of the above
Which of the following is not a term used a synonym for module?
D. object
Modularization
A. facilitates reusability
What is the name for the process of paying attention to important properties while ignoring nonessential details?
C. abstraction
Every module has all of the following except
B. local variables
Programmers say that one module can ________ another, meaning that the first module causes the second module to execute.
A. call
The more that a module's statements contribute to the same job, the greater the ________ of the module.
B. functional cohesion
In most modern programming languages, a variable or constant that is declared in a module is ________ in that module.
B. in scope
Which of the following is not a typical housekeeping task?
A. printing summaries
Which module in a typical program will execute the most times?
B. the detail loop
A hierarchy chart tells you
A. which modules call other modules
What are nonexecuting statements that place within code to explain program statements in English?
A. comments
Program comments are
D. none of the above
Which of the following is valid advice for naming variables?
B. To make names easier to read, separate long names by using underscores or capitalization for each new word
A message that asks a user for input is a(n)
C. prompt
Snarled program logic is called ________ code.
A. spaghetti
The three structures of structured programming are which of the following?
C. sequence, selection, and loop
A sequence structure can contain which of the following?
A. any number of tasks
Which of the following is not another term for a selection structure?
A. loop structure
The structure in which you ask a question, and, depending on the answer, take some action and then ask the question again, can be called all of the following except a(n)
C. if-then-else
Placing a structure within another structure is called ______ the structures.
D. nesting
Attaching structures end to end is called _________.
C. stacking
The statement if age >= 65 then senior Discount = "yes" is an example of a
B. dual-alternative selection
The statement while temperature remains below 60, leave the furnace on is an example of a
B. loop
The statement if age < 13 then movieTicket = 4.00 else movieTicket = 8.50 is an example of a
B. dual-alternative selection
Which of the following attributes do all three basic structures share?
B. They all have one entry and one exit point
Which of true of stacking structures?
C. When you stack structures, the top structure must be a sequence
When you input data in a loop within a program, the input statement that precedes the loop
B. is called a priming input
A group statements that executes as a unit is a
C. block
Which of the following is acceptable is a structured program?
C. all of these are acceptable
In a selection structure, the structure-controlling question is
A. asked once at the beginning of the structure
When a loop executes, the structure - controlling question is
A. asked before and after the loop body executes
Which of the following is not a reason for enforcing structure rules in computer programs?
A. Structured programs usually are shorter than unstructured ones
Which of the following is not a benefit of modularizing programs?
D. If you use modules, you can ignore the rules of structure
Which of the following is true of structured logic?
A. Any task can be described using some combination of three structures
A __________ expression has one of two values: true or false.
D. Boolean
In a selection, the else clause executes
D. when the tested condition is false
The greater-than operator evaluates as true when
B. the left operand is greater than the right operand
A trivial Boolean expression is one that
D. always has the same value
If x <=y is true, then
A. x > y is false
If j <> k is true, then
D. Both b and c are true
In an AND condition, the most efficient technique is to first ask the question that
D. is least likely to be true
If a is true and b is false, then
A. a AND b is false
If p is true and q is false, then
B. p OR q is true
Which of the lettered choices is equivalent to the following decision?
if x > 10 then
if y > 10 then
output "X"
endif
endif
D. if x > 10 AND y > 10 then output "X" endif
If a conditionA is 30 percent likely to be true and conditionB is 10 percent likely to be true, then it is most efficient to test conditionA first
d never
C. in an OR decision
Which of the following is a poorly written, trivial Boolean expression?
C. a < 10 AND a > 40
Which of the following must always be false?
D. e > 10 AND e < 7
Which of the following must always be true?
D. g <> 12 OR g <> 15
In the following pseudocode, what percentage raise will an employee in Department 8 receive?
if department < 5 then
raise = SMALL_RAISE
else
if department < 14 then
raise = MEDIUM_RAISE
else
if department < 9 then
raise = BIG_RAISE
endif
endif
endif
B. MEDIUM_RAISE
In the following pseudocode, what percentage raise will an employee in Department 10 receive?
if department < 2 then
raise = SMALL_RAISE
else
if department < 6 then
raise = MEDIUM_RAISE
else
if department < 10 then
raise = BIG_RAISE
endif
endif
endif
D. impossible to tell
When you use a range check, you always compare a variable to ___________ value in the range.
C. an end-of-range value
If sales = 100, rate = 0.10, and expenses = 50, which of the following expressions is true?
D. two of the above
If a is true, b is true, and c is false, which of the following expressions is true?
D. two of the above
If d is true, e is false, and f is false, which of the following expressions is true?
C. d OR e AND f
The structure that allows you to write one set of instructions that operates on multiple, separate sets of data is the __________.
B. loop
The loop that frequently appears in a program's mainline logic _______.
B. works correctly based on the same logic as other loops
Which of the following is not a step that must occur with every correctly working loop?
C. Set the loop control value equal to a sentinel during each iteration
The statements executed within a loop are known collectively as the ___________.
C. loop body
A counter keeps track of _______________.
D. the number of times an event has occurred
Adding 1 to a variable is also called ______________ it.
A. incrementing
Which of the following is a definite loop?
B. a loop that executes 1,000 times
Which of the following is an indefinite loop?
B. a loop that follows a prompt that asks a user how many repetitions to make and uses the value to control the loop
When two loop are nested, the loop that is contained by the other is the ___________ loop.
B. inner
When the loops are nested, ___________.
D. none of the above
Most programmers use a for loop ____________.
C. when they know the exact number of times a loop will repeat
A report that lists only totals, with no details about individual records, is a(n) __________ report.
C. summary
Typically, the value added to a counter variable is _________.
A. 1
Typically, the value added to an accumulator variable is ___________.
B. different in each iteration
After an accumulator or counter variable is displayed at the end of a program, it is best to ____________.
D. none of the above
When you ___________, you make sure data items are the correct type and fall within the correct range.
D. validate data
Overriding a user's entered value by setting it to a predetermined value is known as __________.
C. forcing
To ensure that a user's entry is the correct data type, frequently you _______________.
B. use a method built into the programming language
A variable might hold an incorrect value even when it is ____________.
D. all of the above
A do-while loop ____________.
C. can be replaced by a sequence and a while loop
You can access every element of an array using a ___________.
C. either of the above
Suppose that you want to write a program that inputs customer data including name, zipCode, balance and regionNum. At the end of the program, a summary of the number of customers in each of 12 sales regions who owe more than $1000 each is displayed. The most likely statement during the main processing loop would be __________.
D. customerCount[regionNum] = customerCount[regionNum] + 1
Each element in an array must have the same ________ as the others.
C. data type
When you use a subscript value that is negative or higher than the number of elements in an array, __________.
B. the resulting action depends on the programming language used
Suppose that you have declared an array as follows: num values[4] = 0, 0, 0, 0. Which of the following is an allowed operation?
D. all of the above
The subscripts of any array are always _________.
C. integers
Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know that _____________.
A. the array has at least five elements
Suppose that you have declared a numeric array that has 13 elements. Which of the following must be true?
D. values[13] is out of bounds
Each element in a seven-element array can hold _______ value(s).
C. one
Filling an array with values during a program's execution is known as _________ the array.
D. populating
Suppose that you have declared an array as follows: num values[4] = 0, 0, 0, 0. Which f the following is an allowed operation?
A. output values[3]
In most modern programming languages, the highest subscript you should use with a 12-element array is __________.
A. 11
Two arrays in which each element in one array is associated with the element in the same relative position are _________.
C. parallel
Suppose that an instructor assigns different letter grades based on points earned on a 10-point quiz, and that all scores have been verified to be between 0 and 10 inclusive. Also suppose that four possible letter grade can be assigned and that 9 or 10 points is an A, 7 or 8 points is a B, 6 points is a C, and 5 or fewer points is an F. To assign letter grades, the most efficient numeric array containing point values would contain __________ elements.
A. three
Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know that _______.
A. there are exactly two elements between those two elements
A subscript is a(n) __________.
B. number that indicates the position of an array element
Parallel arrays ___________.
A. frequently have an indirect relationship
n every array, a subscript is out of bounds when it is __________.
C. negative
A program contains a seven-element array that holds the names of the days of the week. At the start of the program, you display the day names using a subscript named dayNum. You display the same array values again at the end of the program, where you _____ as a subscript to the array.
D. can use dayNum, but can also use another numeric value
A __________ is a variable that can be set to indicate whether some event has occurred.
A. flag
Random access memory is ________.
B. volatile
Which is true of text files?
A. Text files contain data that can be read in a text editor
Every file on a storage device has a _______.
C. both of the above
Which of the following is true regarding the data hierarchy?
A. Files contain records
The process of ________ a file locates it on a storage device and associates a variable name within your program with the file.
D. opening
When you write to a file, you ___________.
D. copy data from memory to a storage device
Unlike when you print a report or display information on a screen, when a program's output is a data file, you do not _________.
A. include explanations or formatting such as dollar signs
When you close a file, it ____________.
C. is no longer available to the program
A file in which records are stored one after another in order based on the contents of a field is a(n) ________ file.
B. sequential
When you combine two or more sorted files while maintaining their sequential order based on a field, you are ______ the files.
C. merging
A control break occurs when a program ____________.
D. pauses to perform special processing based on the value of a field
Which of the following is an example of a control break report?
A. a list of all customers of a business in zip code order, with a count of the number of customers who reside in each zip code
A control break field _____________.
D. causes special processing to occur
Wherever a control break occurs during record processing in any control break program, you must ________.
C. update the value in the control break field
Assume that you are writing a program to merge two files name FallStudents and SpringStudents. Each file contains a list of students enrolled in a programming logic course during the semester indicated, and each file is sorted in student ID number order. After the program compares two records and subsequently writes a Fall student to output, the next step is to ___________.
C. read a FallStudents record
When you merge records from two or more sequential files, the usual case is that the records in the files __________.
A. have the same format
A file that holds more permanent data than a transaction file is a ______ file.
D. Master
A transaction file is often used to _____________ another file.
A. update
The saved version of a file that does not contain the most recently applied transactions is known as a ________ file.
B. parent
Random access files are used most frequently in all of the following EXCEPT _______________.
A. batch processing
Employee records stored in order from highest-paid to lowest-paid have been sorted in __________ order.
D. descending
Student records stored in alphabetical order by last name have been sorted in ____________ order.
D. ascending
When computers sort data, they always ________.
B. use numeric values when making comparisons
Which of the following code segments correctly swaps the values of variables named x and y?
A. x = y
y = temp
x = temp
B. temp = x
x = y
y = temp
C. x = y
temp = x
y = temp
D. temp = x
y = x
x = temp
B. temp = x
x = y
y = temp
Which type of sort compares list items in pairs, swapping any two adjacent values that are out of order?
B. bubble sort
To sort a list of 15 values using a bubble sort, the greatest number of times you would have to pass through the list making comparisons is ____.
D. 14
To completely sort a list of 10 values using a bubble sort, the greatest possible number of required pair comparisons is ____.
D. 81
When you do not know many items need to be sorted in a program, you can create an array that has _____.
C. at least as many elements as the number you predict you will need
In a bubble sort, on each pass through the list that must be sorted, you can stop making pair comparisons _____.
B. one comparison sooner
When performing a bubble sort on a list of 10 values, you can stop making passes through the list of values as soon as ____ on a single pass through the list.
A. no swaps are made
The bubble sort is ________.
C. a relatively easy sort to understand
Data stored in a table that can be accessed using row and column numbers is stored as a ______ array.
D. two-dimensional
A two-dimensional array declared as num myArray [6] [7] has _____ columns.
C. 7
In a two-dimensional array declared as num myArray [6] [7], the highest row number is ____.
B. 5
If you access a two-dimensional array with the expression output myArray [2] [5], the output value will be _____.
D. impossible to tell from the information given
Three-dimensional arrays ______.
A. are supported in many modern programming languages
Student records are stored in ID number order, but accessed by grade-point average for a report. Grade-point average order is a(n) ______ order.
A. logical
When you store a list of key fields paired with the storage address for the corresponding data record, you are creating _____.
A. an index
When a record in an indexed file is not needed for further processing, __________.
C. the record can stay in place physically, but its reference is removed from the index
With a linked list, every record ______.
B. contains a field that holds the address of another record
1. Which of the following is true?
C. A program can contain a method that calls another method.
Which of the following must every method have?
B. a header
Which of the following is most closely related to the concept of local?
C. in scope
Although the terms parameter and argument are closely related, the difference is that argument refers to _____.
D. a value in a method call
A method's interface is its ______.
D. all of the above
When you write the declaration for a method that can receive a parameter, which of the following must be included in the method declaration?
C. two of these
When you use a variable name in a method call, it ____ as the variable in the method header.
A. can have the same name
Assume you have written a method with the header void myMethod(num a, string b). Which of the following is a correct method call?
B. myMethod(12, "Hello")
Assume you have written a method with the header num yourMethod(string name, num code). The method's type is _______.
B. num
Assume you have written a method with the header string myMethod(num score, string grade). Also assume you have declared a numeric variable named test. Which of the following is a correct method call?
A. myMethod(test, "A")
The value used in a method's return statement must _______.
C. match the data type used before the method name in the header
When a method receives a copy of the value stored in an argument used in the method call, it means the variable was _________.
A. passed by value
A void method _________.
D. returns nothing
When an array is passed to a method, it is _________.
A. passed by reference
When you overload a method, you write multiple methods with the same ________.
A. name
A program contains a method with the header num calculateTaxes(num amount, string name). Which of the following methods can coexist in the same program with no possible ambiguity?
B. num calculateTaxes(string name, num amount)
Methods in the same program with identical names and identical parameter lists are _________.
A. ambiguous
Methods in different programs with identical names and identical parameter lists are ________.
D. none of the above
The notion of _________ most closely describes the way a calling method is not aware of the statements within a called methods.