sample input
Set up i/o and range checking.
partial solution
changed temp variable to double. AC.