working(not really)  but weird code on piggy bank

Working code but wrong logic on piggy bank.