Question: In the programs and code that we've looked at and written so far, we've mostly assumed that the user is going to enter something correct.
In the programs and code that we've looked at and written so far, we've mostly assumed that the user is going to enter something "correct". Are they? Can we trust them? (Hint: No. We can't.) That's why our programs need to have checks for valid input. Here are some questions to consider... What are some of the things that can happen if a program doesn't do input validation? What kind of validation do we need to do? How can we validate? What do we need to consider when validating input? Find/build an example piece of code and explain how it validates input. (Don't use the ones from Practice Exercise #3,-)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
