CISP 10 STUDY GUIDE
If you could use only three relational comparison operators, you could get by with.... a. greater than, less than, and greater than or equal to b. less than, less than or equal to, and not equal to c. equal to, less than, and greater than d. equal to, not equal to, and less than
equal to, less than, and greater than
The two commonly used tools for planning a program's logic are...
flowcharts and pseudocode.
Overriding a user's entered value by setting it to a predetermined value is known as ______ a. forcing b. accumulating c. validating d. pushing
forcing
Parallel arrays _____. a. frequently have an indirect relationship b. never have an indirect relationship c. must be the same data type d. must not be the same data type
frequently have an indirect relationship
The value stored in a initialized variable is... a. garbage b. null c. compost d. its identifier
garbage
The to major components of any computer system are its.... a. input and output b. data and programs c. hardware and software d. memory and disk drives
hardware and software
Which of the lettered choices is equivalent to the following decisions? if x > 10 then if y > 10 then output "X" endif endif a. ifx>10ANDy>10thenoutput"X" b. ifx>10ORy>10thenoutput"X" c. ifx>10ANDx>ythenoutput"X" d. ify>xthenoutput"X"
if x > 10 and y > 10 then output "X"
In the following pseudocode, what % 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 raise = BIG_RAISE endif endif endif a. SMALL_RAISE b. MEDIUM_RAISE c. BIG_RAISE d. impossible to tell
impossible to tell
Adding 1 to a variable is also called.... it. a. digesting b. resetting c. decrementing d. incrementing
incrementing
When two loops are nested, the loop that is contained by the other is the ______ loop a. captive b. unstructured c. inner d. outer
inner
The major computer operations include.... a. hardware and software b. input, processing, and output c. sequence and looping d. spreadsheets, word processing, and data communications
input, processing, output
The subscripts of any array are always _____. a. integers b. fractions c. characters d. strings of characters
intergers
The assignment operator... a. is a binary operator b. has left-to-right associativity c. is most often represented by a colon d. two of the above
is a binary operator
In object-oriented programing, a main method.... a. is the name of a class's method if the class contains only one method b. is the name of the method that executes first in an application c. is the method that does most of the work or contains the most instructions d. exists in every class
is the name of the method that executes first in an application.
The chief advantage to using a "for" loop is.... a. infinte loops are prevented b. unlike while loops, they can bee nested. c. is syntax is concise d. unlike with while loops, you can use multiple entry and exit points
its syntax is concise.
The statements executed within a loop are known collectively as the... a. loop body b. loop controls c. sequences d. sentinels
loop body
A set of parentheses always follows a... a. method name b. class name c. variable name d. all of the above
method name
In every array, a subscript is out of bounds when it is _____. a. negative b. 0 c. 1 d. 999
negative
The Boffo Ballon Company makes helium balloons in three sizes, 12 colors, and with a choice of 40 imprinted sayings. As a promotion, the company is offering 25% discount on orders of larder, red "Happy V Days" balloons. To most efficiently slect the orders to whic a discount applies, you would use..... a. three completely separate unnested if statements b. nested if statements using AND logic c. nested if statements using OR logic d. Not enough information is given.
nested "if" statements using "and" logic.
After an accumulator or counter variable is displayed at the end of a program, it is best to ______ delete the variable from the program reset the variable to 0 subtract 1 from the variable a. delete the variable from the program b. reset the variable to 0 c. subtract 1 from the variable d. none of the above
none
In object-oriented programming, the name of class or method... uses pascal casing being s with a lowercase can contain whitespace a. always uses Pascal casing b. always begins with a lowercase letter c. can contain white space d. none of the above
none of the above.
Program comments are... required to create a runnable program a formal external documentation a. required to create a runnable program b. a form of external documentation c. both of the above d. none of the above
none of the above.
Usually, the most difficult comparison operator to work with is a. equal to b. greater than c. less than d. not equal to
not equal to
A subscript is a(n) __________. a. element in an array b. alternate name for an array c. number that represents the highest value stored within an array d. number that indicates the position of an array element
number that indicates the position of an array element
Each element in a five-element array can hold _____ value(s). a. one b. five c. at least five d. an unlimited number of
one
In a flow chart, input is represented by a(n) a. rectangle b. arrow c. diamond d. parallelogram
parallelogram
Filling an array with values during a program's execution is known as _____ the array. a. executing b. colonizing c. populating d. declaring
populating
Visuals basics, C++, and java are all examples of computer... a. operating systems b. hardware c. machine languages d. programming languages
programming languages
18. In a flowchart, processing is represented by a(n) _____. a. rectangle b. arrow c. diamond d. parallelogram
rectangle
Suppose you want to write a program that inputs customer data and displays a summary of the number of customers who owe more than $1,000 each, in each of 12 sales regions. Customer data variables include name, zipCode, balanceDue, and regionNumber. At some point during record processing, you would add 1 to an array element whose subscript would be represented by _____. a. name b. zipCode c. balanceDue d. regionNumber
regionNumber
The selection of statement if quantity > 100 then discountRate = Rate is an example of a... a. single-alternative selection b. dual-alternative selection c. binary selection d. all of these
single-alternative selection
The Boffo Balloon Company makes helium balloons. Large balloons cost 13$ a dozen, medium sized balloons cost 11$ a dozen, and small balloons cost 8.60$ a dozen. About 60% of the company's sales are the smallest balloons, 30% are the medium, and large balloons constitute only 10% of sales. Customers order records include customer information, quantity ordered, and size. For the most efficient decision when you write a program to determine price based on size, you should ask first whether the size is.... a. large b. medium c. small d. It does not matter.
small.
Another term meaning "computer instructions" is... a. hardware b. software c. queries d. data
software
When you use an IDE instead of a simple text editor to develop a program,... a. the logic is more complicated b. the logic is simpler c. the syntax is different d. some help is provided
some help is provided
When you write a program that will run in a GUI environment as opposed to command-line environment,... a. the logic is very different b. some syntax is different c. you do not need to plan the logic d. users are more confused
some syntax is different.
The value "house" is a... a. numeric variable numeric b. constant c. string variable d. string constant
string constant
When you decrement a variable, you.... a. set it to 0 b. reduce it by one-tenth c. subtract 1 from it d. remove it from a program
subtract 1 from it
A report that lists only totals, with no details about individual records, is a(n)____ report.. a. accumulator b. final c. summary d. detailless
summary
A programming language's rules are its... a. syntax b. logic c. format d. options
syntax
A counter keeps track of... a. the number of times an event has occurred b. the number of machine cycles required by a segment of a program c. the number of loop structures within a program d. the number of times software has been revised
the number of times an event has occurred
A variable's data type describes all of the following except... a. what values the variable can hold b. how the variable is stored in memory c. what operations can be performed with the variable d. the parts of the program in which the variable can be used
the parts of the program in which the variable can be used.
When you use a subscript value that is negative or higher than the number of elements in an array, _____. a. execution of the program stops and an error message is issued b. a value in a memory location that is outside the area occupied by the array will be accessed c. either of the above might happen, depending on the programming language used d. neither of the above happens in any modern programming language
the resulting action depends on the programming language used
Suppose you have an array named number, and two of its elements are number[1] and number[4]. You know that _____. a. the two elements hold the same value b. the array holds exactly four elements c. there are exactly two elements between those two elements d. the two elements are at the same memory location
there are exactly two elements between those two elements
The most important task of a compiler or interpreter is to... a. create the rules for a programming language b. translate English statements into a language such as Java c. translate programming language statements into machine language d. execute machine language programs to perform useful tasks
translate programming language statements into machine language
If size has been declared to be a string variable, which of the following is legal? b. size="six" c. size = "6" d. two of the above
two of the above
To ensure that a user's entry is the correct data type, frequently you ______ a. prompt the user, asking if the user is sure the type is correct b. use a method built into the programming language c. include a statement at the beginning of the program that lists the data types allowed d. all of the above
use a method built into the programming language
When you ___, make sure data items are the correct type and fall within the correct range. a. validate data b. employ offensive programming c. use object orientation d. count loop iterations
validate date
The most useful type of subscript for manipulating arrays is a _____. a. numeric constant b. variable c. character d. filename
variable
Using an array can make a program _____. a. easier to understand b. illegal is nome modern languages c. harder to maintain d. all of the above
easier to understand
Which of the following is an indefinite loop? a. a loop that executes exactly 10 times b. a loop that follows a prompt that asks a user how many repetitions to make and uses that value to control the loop c. both of the above d. none of the above
d none of the above
Typically, the value added to a counter variable is ______ a. 0 b. 1 c. 10 d. 100
1
Which of the following is literal numeric constant? a. 12 b. myNumber c. "fourteen" d. all of the above
12
What is the value of expression 8-4*6/4
2
Which of the following evaluates to 10? a. 3 + 5* 2 b. 5 + 20 / 4 c. 25 / 2 + 3 d. all of the above
5 + 20/4
In most modern programming languages, the highest subscript you should use with a 10-element array is _____. a. 8 b. 9 c. 10 d. 11
9
Which of the following is true about arithmetic precedence? a. Multiplication has higher precedence than division. b. Operators with the lowest precedence always have left-to-right associativity. c. Division has higher precedence than subtraction. d. all of the above
Division has higher precedence than subtraction.
Each data item in an array is called a(n) _____. a. data type b. subscript c. component d. element
Element
In the following pseudocode, what % raise will an employee in Department 3 receive? if department < 2 then raise = SMALL_RAISE endif if department < 6 then raise = MEDIUM_RAISE endif if department < 10 raise = BIG_RAISE endif a. SMALL_RAISE b. MEDIUM_RAISE c. BIG_RAISE d. impossible to tell
BIG_RAISE
In the following pseudocode, what % raise will an employee in Department 5 receive? if department < 3 then raise = SMALL_RAISE else if department < 5 then raise = BIG_RAISE endif endif a. SMALL_RAISE b. MEDIUM_RAISE c. BIG_RAISE d. impossible to tell
BIG_RAISE
Which one of the following terms is most closely related to machine language? a. high-level b. source code c. binary language d. all of the above
Binary Language
An expression like: amount < 10 is a(n) expression. a. Gregorian b. Boolean c. Machiavellian d. Edwardian
Boolean
A _____ is a variable that you set to indicate whether some event has occurred. a. subscriot b. banner c. counter d. flag
Flag
The attributes of an object are the things that it... a. has b. does c. influences d. understands
Has
Every structured loop... a. has one entry point b. has two exit points c. refers to a counter that increases on each pass through the loop d. contains a body that must execute at least one time
Has one entry point
Identifying all the objects you want to manipulate and how they relate to each other is known as.... a. object orienting b. data modeling c. method manipulation d. relating
data modeling
Each variable in an array must have the same as the others. a. data type b. subscript c. value d. memory location
Data Type
Radio station FM 99 keeps a record of every song played on the air in a week. Each record contains the day, hour and minute the song started, and the title and artist of the song. The station manger wants a list of every title played during the important 8am commute hour on the two busiest traffic days, Monday and Friday. Which logic would select the correct titles?
If hour = 8 then If day = "Monday" or day = "Friday" then output title endif endif
he Midwest Sales region consists of five state--Illinois, Indiana, Iowa, Missouri, and Wisconsin. About 50% of regional customers reside in Illinois, 20% percent in Indiana, and 10% in each of the other three states. Suppose you have input records containing Acme customer data, including state of residence. To most efficiently select and display all customers who live in the Midwest sales region, you would ask first about residency in..... a.Illinois b. Indiana c. either Iowa, Missouri, or Wisconsin—it does not matter which one of these three is first d. any of the five states; it does not matter which one is first
Illinois.
Typically, the value added to an accumulator variable is ______ a. 0 b. 1 c. the same for each iteration d. different in each iteration
different in each iteration.
The selection statement: if dayOfWeek = "Sunday" then price = LOWER_Price else price = HIGHER_PRICE is an example of a a. unary selection b. single-alternative selection c. dual-alternative selection d. all of the above
dual-alternative selection
The structure that allows you to write one set of instructions that operates on multiple, separate sets of data is the... a. sequence b. selection c. loop d. case
Loop.
In the following pseudocode, what % 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 raise = BIG_RAISE endif endif a. SMALL_RAISE b. MEDIUM_RAISE c. BIG_RAISE d. impossible to tell
MEDIUM_RAISE
variable might hold incorrect values when they are the correct data type within a required range coded by the programmer rather than input by a user a. the correct data type b. within a required range c. coded by the programmer rather than input by a user d. all of the above
NONE
When loops are nested, ______ a. they typically share a loop control variable b. one must end before the other begins c. both must be the same type—definite or indefinite d. none of the above
NONE OF THE ABOVE
The acme computer company operates in all 50 of the United States. The Midwest Sales region consists of five state--Illinois, Indiana, Iowa, Missouri, and Wisconsin. Suppose you have input records containing Acme customer data, including state of residence. To most efficiently select and display all customers who live in the Midwest Sales region, you would use.... a. five completely separate unnested if statements b. nested if statements using AND logic c. nested if statements using OR logic d. Not enough information is given.
Nested if statements using "OR" logic
Object-oriented programming focuses most on.... a. data b. objects c. procedures d. arithmetic
Objects
What do you call two arrays in which each element in one array is associated with the element in the same relative position in the other array? a. cohesive arrays b. parallel arrays c. hidden arrays d. perpendicular arrays
Parallel arrays
A message that asks a user for input is a... a. comment b. prompt c. echo d. declaration
Prompt.
Symbols like > and < are known as.... operations a. arithmetic b. relational comparison c. sequential d. scripting accuracy
Relational Comparison
Which of the following is the list of the three structures used in structured programming? a. sequence, skip, and go b. selection, choice, and if-then c. sequence, selection, and loop d. selection, loop, and method
Sequence, selection, and loop.
Which of the following is not a step that must occur with every correctly working loop? a. Initialize a loop control variable before the loop starts. b. Set the loop control value equal to a sentinel during each iteration. c. Compare the loop control value to a sentinel during each iteration. d. Alter the loop control variable during each iteration.
Set the loop control value equal to a sentinel during each iteration.
Which of the following is true? a. The AND operator has higher precedence than the OR operator. b. The OR operator has higher precedence than the AND operator. c. The AND and OR operators have the same precedence. d. The precedence of AND and OR operators depends on the programming language.
The "AND" operator has higher precedence than the "OR" operator.
Which of the following is true about newer programming languages as opposed to older ones? a. They do not require as much logic as older languages. b. They do not have specific syntax rules. c. Their programs tend to be written as one set of steps instead of being broken into modules. d. They allow you to use reasonable names for memory locations.
They allow you to use reasonable names for memory locations.
Which of the following is valid advice for naming variables? a. To save typing, make most variable names one or two letters. b. To avoid conflict with names that others are using, use unusual or unpronounceable names. c. To make names easier to read, separate long phrases by using underscores or capitalization for each word. d. To maintain your independence, shun the conventions of your organization.
To make names easier to read, separate long phrases by using underscores or capitalization for each word.
Usually, you compare only variable that have the same.... a. value b. size c. name d. type
Type.
If a > b is false, then which of the following is always true? a. a<b b. a<=b c. a=b d. a>=b
a < = b
Which of the following is a definite loop? a. a loop that executes as long as a user continues to enter valid data b. a loop that executes 1000 times c. both of the above d. none of the above
a loop that executes 1000 times
A compiler would find all of the following programming errors except... a. the misspelled word "prrint" in a language that includes the word "print" b. the use of an "X" for multiplication in a language that instead requires an asterisk c. a newBalanceDue calculated by adding a customerPayment to an oldBalanceDue instead of subtracting it d. an arithmetic statement written as regularSales + discountedSales = totalSales
a newBalanceDue calculated by adding a customerPayment to an oldBalanceDue instead of subtracting it.
Which of the following is true in object oriented programing? a. All classes are applications. b. All applications are system applications. c. All applications are programs. d. All programs are applications.
all applications are programs
Suppose you have declared an array as follows: num values[4] = 0, 0, 0, 0. Which of the following is an allowed operation? a. values[2] = 17 b. input values[0] c. values[3] = values[0] + 10 d. all of the above
all of the above
All selection statements must have... a. an if clause b. an else clause c. both of these d. none of these
an if clause
What does a declaration provide for a variable? a. a name b. a data type c. both of the above d. none of the above
both of the above
You can access every element of an array using a _____. a. while loop b. for loop c. both of the above d. none of the above
both of the above
In object-oriented programming, each object... a. maintains its own data b. carries out tasks when another object requests them c. both of these d. none of these
c both of these
At the start of a program, you declare a seven-element array that holds the names of the days of the week, and a single numeric variable named dayNum. Later, you display the names using dayNum as a subscript. Near the end of the program, you can display the same array values again by writing a loop that ______________as a subscript to the array. a. must use dayNum b. can use dayNum, but instead can use another variable c. must not use dayNum, and must use a different variable d. must use a numeric constant instead of a variable
can use "dayNum", but can also use another variable
Writing a program in a language such as C++ or java is known as...the program a. translating b. coding c. interpreting d. compiling
coding
Originally, object-oriented programming was used most frequently for two major types of applications. These were... a. payroll and inventory b. input and storage c. computer simulations and graphical user interfaces d. public and private applications
computer simulations and graphical user interfaces.
Which of the following statements is true if a declaration has been made as follows: num count = 9 a. count is an uninitialized variable b. countisanumericvariable c. count is a literal d. all of the above
count is a numeric variable
Which of the following statements is true if a declaration has been made as follows: num count. a. count is an initialized variable b. countisanumericvariable c. count is a literal d. all of the above
count is a numeric variable
