updated script.js

Updated script with input and data validation, also added in the
calculations.  Still in draft stage and testing the output.