First draft of Problem A.  No input sanitazation or exception handling.