Starting Out with Programming Logic and Design 3rd Edition Tony Gaddis Test Bank download
Starting Out with Programming Logic and Design 3rd Edition Tony Gaddis Test Bank download
https://testbankdeal.com/product/starting-out-with-programming-
logic-and-design-3rd-edition-tony-gaddis-test-bank/
https://testbankdeal.com/product/starting-out-with-programming-logic-
and-design-3rd-edition-tony-gaddis-solutions-manual/
https://testbankdeal.com/product/starting-out-with-programming-logic-
and-design-4th-edition-tony-gaddis-test-bank/
https://testbankdeal.com/product/starting-out-with-programming-logic-
and-design-4th-edition-tony-gaddis-solutions-manual/
https://testbankdeal.com/product/multicultural-law-enforcement-6th-
edition-shusta-test-bank/
Byrd And Chens Canadian Tax Principles 2011 2012 Edition
Canadian 1st Edition Byrd Test Bank
https://testbankdeal.com/product/byrd-and-chens-canadian-tax-
principles-2011-2012-edition-canadian-1st-edition-byrd-test-bank/
https://testbankdeal.com/product/marketing-research-asia-pacific-4th-
edition-zikmund-solutions-manual/
https://testbankdeal.com/product/real-estate-finance-and-
investments-15th-edition-brueggeman-test-bank/
https://testbankdeal.com/product/absolute-c-5th-edition-savitch-
solutions-manual/
https://testbankdeal.com/product/international-politics-power-and-
purpose-in-global-affairs-3rd-edition-paul-danieri-solutions-manual/
Personal Finance 13th Edition Garman Test Bank
https://testbankdeal.com/product/personal-finance-13th-edition-garman-
test-bank/
Gaddis: Starting Out with Programming Logic & Design Test Bank
Chapter Seven
MULTIPLE CHOICE
1. What is the famous saying among computer programmers that refers to the fact that computers
cannot tell the difference between good and bad data?
a. Garbage input, garbage output
b. Garbage in, garbage out
c. Garbage output is from garbage inputted
d. Garbage out is from garbage in
e. None of the above
ANS: B
2. The purpose of the __________ is to get the first input value for the validation of a loop.
a. GIGO
b. Read
c. Priming read
d. Write
e. None of the above
ANS: C
ANS: A
4. _______________ happens when an input operation attempts to read data, but there is no data
to read.
a. No data
b. Error reading
c. Input error
d. Empty input
e. None of the above
ANS: D
5. Input ______________ is commonly done with a loop that iterates as long as an input variable
contains bad data.
a. Check
b. Validation
c. Examination
d. Priming
e. None of the above
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 2
ANS: B
ANS: B
7. In addition to using loops to validate data, _____________ can also be used to validate data.
a. String Function
b. Real Function
c. Integer Function
d. Boolean Function
e. None of the above
ANS: D
ANS: D
ANS: D
10. What is the first step to use in detecting data type mismatch errors?
a. Read the input as a string
b. Convert to the desired data type
c. Determine whether it can be converted
d. Display error message
e. None of the above
ANS: A
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 3
c. Below
d. Inside and before
e. Inside and below
ANS: B
12. Which of the following statements is true about this Boolean expression?
score < 0 AND score > 100
a. This expression is true for numbers between 0 and 100.
b. This expression is true for numbers greater than 100.
c. This expression is true for numbers less than 0.
d. This expression would never be true.
e. None of the above
ANS: D
13. What type of function can be used to see if the password entered has the minimum number of
characters?
a. Mathematical
b. Boolean
c. String
d. Trigonometric
e. None of the above
ANS: C
14. If, when asked for a date of birth, the user enters a future date, this error should be caught by a
____________ check.
a. Date
b. Time
c. Day
d. Reasonableness
e. None of the above
ANS: D
15. Accepting February 29 in only a leap year is a check that is done by a ___________ check.
a. Date
b. Day
c. Month
d. Calendar
e. None of the above
ANS: A
16. Which of the following library functions could be used to validate the length of a string?
a. random
b. isString
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 4
c. length
d. toUpper
e. None of the above
ANS: C
17. Which of the following library functions could be used to validate that the correct data type was
input for an amount of money?
a. isInteger
b. isString
c. toLower
d. isReal
e. All of the above
ANS: D
18. Which of the following library functions could be used to simplify the process of string
validation?
a. length
b. toUpper
c. isReal
d. isInteger
e. None of the above
ANS: B
TRUE/FALSE
1. True/False: An input validation loop is sometimes called an error handler.
ANS: T
2. True/False: If the user provides bad data as input to a program, the program will correct the
data and produce output.
ANS: F
3. True/False: Programs should be designed such that all input is inspected before it is processed
and bad data is discarded.
ANS: T
ANS: T
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 5
ANS: T
6. True/False: The empty read is not an obvious input error and is a difficult one to handle.
ANS: F
7. True/False: The practice of anticipating errors that can happen while a program is running and
designing the program to avoid those errors is called defensive programming.
ANS: T
8. True/False: Checking for accuracy of data, even when the user provides the right type of data,
is part of input validation.
ANS: T
ANS: F
10. True/False: When using string input validation it is wise to use the library function to convert the
input to upper case or lowercase so case-sensitive string comparisons can be made.
ANS: T
11. True/False: Input validation is not needed if the program is well designed.
ANS: F
12. True/False: Most programming languages do not provide library functions that can be used for
input validation.
ANS: F
ANS: input
2. __________ programming is the practice of anticipating errors that can happen while a program
is running.
ANS: Defensive
3. The acronym ___________ is used by programmers to refer to the fact that computers cannot
tell difference between good and bad data.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 6
ANS: GIGO
4. The input operation that is performed just before a validation loop is known as the _________.
5. The _________________ occurs when the user presses the ENTER key without typing a value
for an input operation.
6. Using a ________________ function many times would simplify the long compound Boolean
expression that is used by a validation loop.
ANS: Boolean
7. To validate if the input data is a valid integer, use the __________ library function.
ANS: isInteger
8. An input validation that accepts strings in mixed case would have incorporated a case-
__________ string comparison operation.
ANS: insensitive
9. The string _________ function plays a role in the string’s validity when a minimum number of
characters are required to be entered.
ANS: length
10. A _________ loop could be used to validate input instead of using the priming read.
ANS: posttest
11. When a payroll program verifies that no value greater than 168 is entered for the number of
hours worked in a week, it is performing a ___________________ check.
12. After the string is read it is determined if it can be converted to the desired data type in a
_____________ error.
13. When a loop rejects any input except the strings “yes” and “no” then it is performing a case-
___________ comparison.
ANS: sensitive
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 7
ANS: pretest
15. The integrity of a program’s output is only as good as the integrity of the program’s ________.
ANS: input
16. When ____________ data is entered by the user, the program should at least ask the user to
confirm that he or she intended to enter it.
ANS: unreasonable
17. When the user enters a U.S. Address, the value entered as the ________ should be checked to
verify that it is both valid and in the correct format.
18. You should design your programs in such a way that bad ____________ is never accepted.
ANS: input
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Random documents with unrelated
content Scribd suggests to you:
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
testbankdeal.com