revised cash_regiter program to handle string input