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/
testbankdeal.com
https://testbankdeal.com/product/starting-out-with-programming-logic-
and-design-4th-edition-tony-gaddis-test-bank/
testbankdeal.com
https://testbankdeal.com/product/starting-out-with-programming-logic-
and-design-4th-edition-tony-gaddis-solutions-manual/
testbankdeal.com
https://testbankdeal.com/product/strategic-management-a-dynamic-
perspective-concepts-2nd-edition-carpenter-test-bank/
testbankdeal.com
Biology A Guide to the Natural World 5th Edition Krogh
Test Bank
https://testbankdeal.com/product/biology-a-guide-to-the-natural-
world-5th-edition-krogh-test-bank/
testbankdeal.com
https://testbankdeal.com/product/aging-and-the-life-course-an-
introduction-to-social-gerontology-7th-edition-quadagno-solutions-
manual/
testbankdeal.com
https://testbankdeal.com/product/thomas-calculus-early-
transcendentals-13th-edition-thomas-solutions-manual/
testbankdeal.com
https://testbankdeal.com/product/complete-diagnosis-coding-
solution-3rd-edition-safian-test-bank/
testbankdeal.com
https://testbankdeal.com/product/developmental-mathematics-through-
applications-1st-edition-akst-test-bank/
testbankdeal.com
Anatomy and Physiology 1st Edition McKinley Solutions
Manual
https://testbankdeal.com/product/anatomy-and-physiology-1st-edition-
mckinley-solutions-manual/
testbankdeal.com
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.
Another Random Scribd Document
with Unrelated Content
Huhuu! huhuu!
Lapio vaan on tarpeen
Huhuu! huhuu!
Hän ei pelännyt ketään koko kylässä, paitsi kirjuria. Kun hän vaan
kaukaakin näki vihriäraitaisen lakin, pystyn nokan ja pienen
pukinparran korkeilla jaloillaan ja hiljalleen likenevän, niin hän
paikalla kävi kiinni lakkiinsa. Kirjuri tiesi hänestäkin pienen jutun.
Kerran myrskyisinä aikoina oli Rzepaa käsketty viemään eräitä
papereita johonkin ja hän oli ne vienyt. Sen enempää hän ei niistä
tietänyt. Olihan hän siihen aikaan vasta viidentoista vanha poika ja
paimensi hanhia ja sikoja. Mutta myöhemmin hän tuli ajatelleeksi,
että häntä ehkä sentään vaaditaan tilinteolle noitten paperien
kuljetuksesta ja sentähden hän pelkäsi kirjuria.
Rzepa hämmästyi.
— Mitä siitä? Kyllä hän tietää, että sinä kannoit ne paperit toisesta
metsästä toiseen.
Kirjuri oli nuorimies, hänellä ei siis ollut omaa taloutta, vaan hän
asui neliskulmaisessa, niinkutsutussa "rapatussa talossa", joka oli
lammin rannalla. Hänellä oli siellä erityinen etehinen ja kaksi
huonetta. Ensimmäisessä huoneessa ei ollut muuta kuin hiukan olkia
ja päällyssaappaat. Toista huonetta käytettiin sekä salina että
makuuhuoneena. Vuode näytti siltä kuin ei sitä ikinä olisi järjestetty,
tyynyissä ei ollut vaaruja ja höyhenet pistivät esiin. Vuoteen vieressä
oli pöytä, pöydällä mustepullo, kyniä, kansliakirjoja, muutama vihko
herra Breslauerin kustantamaa Isabella Espanjalaista, kaksi likaista
englantilaista kaulusta, pomaadapurkki, paperossihylssyjä ja lopuksi
talikynttilä, joka seisoi läkkisessä jalassa ja jonka sydän oli
ruskeahtava; kärpäsiä oli hukkunut taliin kynttilän sydämen
ympärille.
Haava ärtyi.
Peto pauloissa.
— No, koska olette olevinanne niin kovin viisas, niin sanokaa, mikä
oli ensimmäisen ihmisen nimi?
— Maljanne, kuomaseni!
— Maljanne!
— Haim!
— Siulim![9]
— Onneks' olkoon!
He joivat kaikki kolme, mutta koska siihen aikaan juuri oli sota
Ranskan ja Preussin välillä, niin lautamies Gomula taasen palasi
politiikkaan.
— Onneks' olkoon!
— Kost' jumala!
— Antaa tulla!
— Ei ole sanottu.
— Tahdotteko koettaa?
— Olkaa siivolla, keskeytti nyt herrastuomari. — Oikeinko te aiotte
tapella? Juodaan pois vielä.
— Kirjuri sanoi…
Rzepa oli istunut lakki takaraivolla. Nyt hän kiireesti vetäisi sen
päästään, pudotti maahan, nousi ja änkötti:
— Ylistetty…
— Herra kirjuri…
— Mitä?
Pari kertaa hän nyökäytti sinne tänne, keikahti sitte alas penkiltä,
sopersi mennessään: "Jumala, ole minulle syntiselle armollinen!" ja
nukkui.
— Szmul!
Hän oli mies joka tiesi hienon maailman tavat ja joka ei koskaan
joutunut hämilleen. Hän ei milloinkaan kadottanut mielenmalttiaan,
vaan sekaantui rohkeasti keskusteluun, muistellen joko "tuota kelpo
komisariusta" tai "tuota erinomaista tirehtööriä", jonka kanssa hän
"eilen tai tässä tuonnoin" pelasi yhden kopeekan tikkiä. Sanalla
sanoen: Zolzikiewicz koetti kaikin voimin näyttää, että hän ja
Aasinkorvan piirikunnan johtavat miehet ovat likeisissä väleissä
keskenään. Tosin hän huomasi, että herrasväet hänen kertoessaan
vähän oudosti painuivat katselemaan lautasiaan, mutta hän ajatteli
että tapa sen vaatii. Monasti häntä myöskin oli hämmästyttänyt se,
ettei aatelinen isäntä, päivällisen päätyttyä, odottanut hänen
hyvästijättöään, vaan itse tuli taputtamaan häntä olalle ja
sanomaan: "no, jääkää hyvästi nyt, herra Zolzikiewicz!" mutta hän
arveli taaskin että tapa hienossa seurassa sen vaati. Kun hän sitte
hyvästi sanoessaan painoi talon herran kättä, tapasi hän aina siitä
jotakin kilisevää. Paikalla hän pusersi kokoon sormensa ja raapaisten
aatelisherran kämmentä, koppasi siitä kilisevän kappaleen. Mutta
samalla ei hän koskaan unohtanut lisätä: "voi, hyvä herra, ei sitä nyt
olisi ensinkään tarvittu!… Tuohon käräjäjuttuun nähden taas ei
herran ensinkään tarvitse huolehtia."
— Mutta minkätähden?