cash register solution from class