Input Validation

Jessica McWilliams, Towson University

While putting the finishing touch on my trace,
I found a problem I had to erase,
The user can enter the denominator,
Before the division will occur.

What if the user enters a zero?
Input Validation will be my hero,
An “if” statement is all it takes to,
Save the world from implosion for you.

Input validation has other uses too,
If you don’t want to turn three hundred and two;
on your birthday on the forty-third of June.

What if the user is sleep deprived?
And asked for their name, they simply put 5?
Input validation can check for the right type,
and give an error message if it’s not right.

When I fixed my program a thought came to me:
Input Validation is all about security,
If used correctly it makes my programs robust,
So I can be a programmer you trust.

Copyright © Towson University