Title: Module 5 Quiz (Ungraded)
Course: COP 1510 Programming Concepts > Section: Module 5 - Input Validation

Q: Accepting February 29 in only a leap year is a check that is done by a ________ check.
- Date
- Day
- Month
- Calendar
- None of these
A: Date

Q: Which of the following library functions could be used to validate the length of a string?
- random
- isString
- length
- toUpper
- None of these
A: length

Q: Which of the following library functions could be used to validate that the correct data type was input for an amount of money?
- isInteger
- isString
- toLower
- isReal
- All of these
A: isReal

Q: Which of the following library functions could be used to simplify the process of string validation?
- length
- toUpper
- isReal
- isInteger
- None of these
A: toUpper

Q: ________ is sometimes the term used for input validation.
- Input error
- Error trap
- Input trap
- Data error
- None of these
A: Error trap

Q: Input ________ is commonly done with a loop that iterates as long as an input variable contains bad data.
- Check
- Validation
- Examination
- Priming
- None of these
A: Validation

Q: ________ happens when an input operation attempts to read data, but there is no data to read.
- No data
- Error reading
- Input error
- Empty input
- None of these
A: Empty input

Q: Designing a program to avoid common errors is called ________ programming.
- Defensive
- Direct
- Defective
- Detective
- None of these
A: Defensive

Q: The purpose of the ________ is to get the first input value for the validation of a loop.
- GIGO
- Read
- Priming read
- Write
- None of these
A: Priming read

Q: What is the famous saying among computer programmers that refers to the fact that computers cannot tell the difference between good and bad data?
- Garbage input, garbage output
- Garbage in, garbage out
- Garbage output is from garbage inputted
- Garbage out is from garbage in
- None of these
A: Garbage in, garbage out

Q: If, when asked for a date of birth, the user enters a future date, this error should be caught by a ________ check.
- Date
- Time
- Day
- Reasonableness
- None of these
A: Reasonableness

Q: What type of function can be used to see if the password entered has the minimum number of characters?
- Mathematical
- Boolean
- String
- Trigonometric
- None of these
A: String

Q: Which of the following statements is true about this Boolean expression?
- This expression is true for numbers between 0 and 100.
- This expression is true for numbers greater than 100.
- This expression is true for numbers less than 0.
- This expression would never be true.
- None of these
A: This expression would never be true.

Q: The priming read is placed ________ the loop.
- Inside
- Before
- Below
- Inside and before
- Inside and below
A: Before

Q: What is the first step to use in detecting data type mismatch errors?
- Read the input as a string
- Convert to the desired data type
- Determine whether it can be converted
- Display error message
- None of these
A: Read the input as a string

Q: True/False: An input validation loop is sometimes called an error handler.
- True
- False
A: True

Q: True/False: If the user provides bad data as input to a program, the program will correct the data and produce output.
- True
- False
A: False

Q: True/False: Most programming languages do not provide library functions that can be used for input validation.
- True
- False
A: False

Q: True/False: Input validation is not needed if the program is well designed.
- True
- False
A: False

Q: 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.
- True
- False
A: True