How might user data be validated?
What will be an ideal response?
When you ask a user to enter data into a computer program, you have no assurance that the data the user enters will be accurate. Loops are frequently used to validate data; that is, to make sure it falls within an acceptable range. For example, suppose part of a program you are writing asks a user to enter a number that represents his or her birth month. If the user types a number less than 1 or greater than 12, you must take some sort of action. For example:
• You could display an error message and stop the program.
• You could choose to assign a default value for the month (for example, 1) before proceeding.
• You could reprompt the user for valid input.
You might also like to view...
Some advanced printers have print server programs included in the printer firmware itself.
Answer the following statement true (T) or false (F)
When you need to type a long and complex URL in the Property inspector, it is easy to make mistakes and create a broken link.
Answer the following statement true (T) or false (F)